Linux: FUSE and thread termination
These days, I'm trying to write a file system via FUSE. During the debugging, I found that if I want to use threads with pthread, I need to create my own thread from init function of fuse operations.
If I create thread from main function before I call fuse_main, my thread will be terminated soon after fuse_main function calling.
I saw the FAQ of FUSE and it mentioned all thread should be created from init because when the FUSE process goes to background the threads which was started before fuse_main will be exited. Please see the below references.
References:
If I create thread from main function before I call fuse_main, my thread will be terminated soon after fuse_main function calling.
I saw the FAQ of FUSE and it mentioned all thread should be created from init because when the FUSE process goes to background the threads which was started before fuse_main will be exited. Please see the below references.
References:
- How should threads be started?: http://sourceforge.net/apps/mediawiki/fuse/index.php?title=FAQ#How_should_threads_be_started.3F
- http://fuse.sourceforge.net/
댓글
댓글 쓰기