From: xiangyong o. <ou...@cs...> - 2010-10-12 20:57:55
|
Michael and Nikolaus, thanks a ton for your comments! -Ouyang On Tue, Oct 12, 2010 at 4:18 PM, Michael Raskin <fb0...@ra...> wrote: > On 10/12/2010 11:19 PM, xiangyong ouyang wrote: >> Program A does a fork(), then: >> >> parent-proc child-proc >> -------------- -------------- >> call fuse_main() >> >> access fuse-Filesystem >> >> call "fusermount -u" >> >> It seems it's able to work properly. >> However, pthread_create() doesn't do the job as fork(). What's the >> internal difference caused by the two approaches? Thanks! > > fork() : create a new process (for example, memory stops being shared no > later than on the first write to it) > pthread_create() : create a new thread (shared resources) > > fuse_main seems to think that it can safely take over all the process > and the sole purpose of the process is to serve one filesystem. With > fork(), parent is safe with another PID. With pthread_create(), parent > thread may be even terminated by fuse_main (currently this doesn't > happen) - there are no guarantees. > |