|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Using FUSE in daemon programHello!
I'm working on daemon program for Linux. My program is not a regualr unix daemon, it works only in user session (starts with GNOME sessions and and when user logs out). I'm new to FUSE project and have few questions. Firs of all I need to manually fork my program, so I can't use fuse_main(), because I handle some things in separated threads (DBus connection, TCP server etc.), so I want to manually initialize and run fuse loop in separated thread. Is it possible? As I read fuse can run in threaded mode? How it work? As I understand in single thread mode fuse run loop and dispatch all file system requests (open, read, write) inside this loop right? How does this work for multi thread mode? Fuse loop dispatch each request in separated thread or what? ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ fuse-devel mailing list fuse-devel@... https://lists.sourceforge.net/lists/listinfo/fuse-devel |
|
|
Re: Using FUSE in daemon programTomasz Jankowski wrote:
> First of all I need to manually fork my program, so I can't use fuse_main(), > because I handle some things in separated threads (DBus connection, TCP > server etc.), so I want to manually initialize and run fuse loop in > separated thread. Is it possible? Yes. I recently did lisp bindings (GC uses signals, so no fuse_main for me), I ended up calling the following functions in the following order (normal session): fuse_parse_cmdline (could do without it) fuse_mount fuse_new fuse_opt_free_args fuse_get_session fuse_chan_bufsize fuse_session_exited (loop condition) fuse_chan_recv fuse_session_process fuse_unmount fuse_destroy These functions are enough to emulate fuse_main. I doubt there is a shorter non-deprecated way for my task. I guess your requirements are similar: FUSE calls should not manage threads in any way. > As I read fuse can run in threaded mode? How it work? As I understand in > single thread mode fuse run loop and dispatch all file system requests > (open, read, write) inside this loop right? How does this work for multi > thread mode? Fuse loop dispatch each request in separated thread or what? Approximately. You don't need it, though. You can pack your fuse_session_process calls into threads to your heart's pleasure. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ fuse-devel mailing list fuse-devel@... https://lists.sourceforge.net/lists/listinfo/fuse-devel |
|
|
Re: Using FUSE in daemon programTomasz Jankowski <tomcioj@...> writes:
> Hello! > > I'm working on daemon program for Linux. My program is not a regualr unix > daemon, it works only in user session (starts with GNOME sessions and and > when user logs out). I'm new to FUSE project and have few questions. > > Firs of all I need to manually fork my program, so I can't use fuse_main(), > because I handle some things in separated threads (DBus connection, TCP > server etc.), so I want to manually initialize and run fuse loop in > separated thread. Is it possible? Certainly possible but unneccessary. You can simply start your own threads in the init callback. > As I read fuse can run in threaded mode? How it work? As I understand in > single thread mode fuse run loop and dispatch all file system requests > (open, read, write) inside this loop right? How does this work for multi > thread mode? Fuse loop dispatch each request in separated thread or what? Fuse starts a number of threads that all block reading /dev/fuse. Then as requests come in one of them returns from read and calls the appropriate callback. For the exact behaviour compare the single and multi threaded loop in the source. MfG Goswin ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ fuse-devel mailing list fuse-devel@... https://lists.sourceforge.net/lists/listinfo/fuse-devel |
| Free embeddable forum powered by Nabble | Forum Help |