-
Notifications
You must be signed in to change notification settings - Fork 191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
“nothreads” argument explanation #138
Comments
This is something that can be enabled with while ( !fuse_session_exited() ) {
fuse_session_receive_buf();
fuse_session_process_buf();
} This high-level API uses libfuse low-level API calls for its implementation. It is an event loop that receives FUSE messages as documented here from the kernel via some communication file descriptor, which can be queried with The multi-threaded version fuse_start_cleanup_thread();
/* fuse_session_loop_mt */
fuse_loop_start_thread(); // basically starts thread that runs fuse_do_work
while ( !fuse_session_exited() ) {
/* wait */
/* Cancel and destroy threads. */
for (w = mt.main.next; w != &mt.main; w = w->next)
pthread_cancel(w->thread_id);
while (mt.main.next != &mt.main)
fuse_join_worker(&mt, mt.main.next);
fuse_stop_cleanup_thread(); So yeah, there seems to be:
The worker threads have an event loop like this: while ( !fuse_session_exited() ) {
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, NULL);
res = fuse_session_receive_buf(mt->se, &fbuf, &ch);
pthread_setcancelstate(PTHREAD_CANCEL_DISABLE, NULL);
/* Start more worker threads on demand. */
if (mt->numavail == 0)
fuse_loop_start_thread(mt);
fuse_session_process_buf();
/* Delete worker on demand. */
if (mt->numavail > 10) {
list_del_worker(w);
mt->numavail--;
mt->numworker--;
}
} So yeah, it is the basic loop that we already saw in the single-threaded Note that fusepy automatically adds |
I've been fiddling for a bit with the
fuse
package with python3.When trying to create a FUSE instance, I came across the
nothreads
argument.Can anyone please elaborate on what this does?
I can guess that setting this flag to
True
the software no longer supports multithreading, but what I would like to know is how it changes the software's behaviour, what would the flow be with and without setting it toTrue
?Thanks
The text was updated successfully, but these errors were encountered: