On 12/3/19, 9:03 PM, "sejun.kwon(a)samsung.com" <sejun.kwon(a)samsung.com>
wrote:
Hello, All.
Lately, I updated the spdk version from 19.01 to spdk 19.10. And I noticed that
spdk_thread_create is slightly differnet.
The scenario I want to implement is as below.
1) spdk_thread_lib_init -> reactor_start
2) (In another thread, ) spdk_thread_create, and this spdk_thread needs to be belong
to the thread which is not a reactor (but to while loop)
In 19.01, it is okay, but in 19.10 if I use spdk_thread_create, that spdk_thread is
registered to one of reactors with given cpu_mask because g_new_thread_fn is registered in
reactor_start step. If given cpu_mask does not contains cpus of reactor, that
spdk_thread_create operation is failed.
So, I put g_new_thread_fn == NULL between 1), 2) (because reactor_start() inits
g_new_thread_fn as its own function) and it works in my environment,
but, I'm not sure this is safe way to register thread without reactor. Please let
me know the way how to create just thread not to a reactor, even after initializing
reactors.
Hi Sejun,
I think what you've done should work, but it would be nicer to have a way to do it
through the SPDK thread API. There really isn't a way to do that currently. Maybe we
should have a new function - something like spdk_thread_create_no_schedule()? This would
behave exactly like spdk_thread_create(), except skip calling the g_new_thread_fn.
-Jim