From: Nikolaus R. <Nik...@ra...> - 2009-08-17 16:10:14
|
Csaba Henk <csa...@cr...> writes: > On 2009-08-15, Nikolaus Rath <Nik...@ra...> wrote: >> I was wondering if it is in principle possible to have multiple requests >> handled by multiple processes rather than threads, or if the design of >> fuse forbids this. Can several processes communicate with the kernel >> module in parallel? If so, how complex would the implementation be? > > This is perfectly viable. The fd to /dev/fuse will be inherited after > forking so the kernel can know which fs is at the other end of the line. > I don't know of any FUSE specific gotchas -- the hardness is IPC in > general. There is no partial reading/writing on /dev/fuse and things > like fragmented packets, so communication with it is straightforward. That sounds very promising. How would I go about implementing this? I just looked over the fuse sources, and it would almost seem that it is as simple as 1. Call fuse_setup_common() in the main process 2. Fork childs 3. Call fuse_loop() in each child But there are probably some more gotchas...? Are there any issues when fuse shuts down? Should I call fuse_teardown_common() in every process or just in the main one? Best, -Nikolaus -- »Time flies like an arrow, fruit flies like a Banana.« PGP fingerprint: 5B93 61F8 4EA2 E279 ABF6 02CF A9AD B7F8 AE4E 425C |