* Yes, I didn't explain correctly ... it's the callback that sends back data using pipe. I'm already sending private data in shttpd_register_uri, which includes that pipe. But if it is shttpd that spawns worker threads were do this ?
* I need to call my init_logging function on each of shttpd's worker threads (to have nice enter/exit traces). Again if it is shttpd that spaws workers were do I do this ? * What happens if configuration changes (doc_root change for example)? Do you plan to call set_option for each worker thread or kill/launch new worker threads? * Who calls shttpd_fini (to cleanup) for each worker thread? Related ... how do you intend to end/kill the worker threads ? * Shttpd forces posix threads, a good choice but I use apache portable runtime apr_thread_create instead. For me shttpd should be about http, not threads. Thanks in advance, Rui ________________________________________ From: Sergey Lyubka [mailto:[EMAIL PROTECTED] Sent: quarta-feira, 28 de Maio de 2008 14:03 To: Rui Jorge Coelho Cc: shttpd-general Subject: Re: [shttpd-general] Accept callback: threads and pipes Okay let's see if I understand that correctly. Your program has its own event loop, processing other protocols other than HTTP. In addition to that, you are getting requests from browser (or any other source), that are HTTP. If I understand that correctly, all you need to do is spawn one thread with boss shttpd context in it. It will take care of all your HTTP requests. I do not understand why boss shttpd thread must send anything back to the main program? >From my understanding, this is the callback functions, that actually are getting some data, might communicate with main program - using a pipe or whatever. When you are registering an URI, you can specify a private pointer which will be passed to the callback, that pointer may also point to the pipe. Could you be more clear when describing your architecture, please? ------------------------------------------------------------------------- This SF.net email is sponsored by: Microsoft Defy all challenges. Microsoft(R) Visual Studio 2008. http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ _______________________________________________ shttpd-general mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/shttpd-general
