From: Goswin v. B. <gos...@we...> - 2011-02-03 13:32:42
|
Stef Bon <st...@gm...> writes: > Well I'm, still working on the fuse mainloop managed by epoll, which > distributes the incoming signals/events from fuse to the worker > threads. > > I've written a simple program, threadsignal, you'll find attached. > It start one thread, and then waits for the user. It cactches the > signals sigint (and others) by using signalfd, and when Ctrl-C is > pressed, it writes one char to a pipe. > The other end of the pipe is watched by thread1, which reads it and > prints on the screen. > > It's very simple, and maybe the communication between the mainprogram > and the thread could be different (I do not know how), this works > very good. > > This could also be used with fuse, the mainprogram reading the fuse > events, and creating a pool of worker threads. The mainprogram sends > the signal to the thread which is free, not doing anything. > > I'm sharing this here. If you think it's too much/too complicated, fine by me. > For me this it's still an issue to use epoll, cause there is no other > way to listen next to the fuse fd, to another fd, like inotify, and > maybe others (libevent??). > > I will call it fuse_loop_epoll_mt.c. If anyone interested, let me know. > > Stef Still, why not have all the worker threads just epoll? MfG Goswin |