I cannot have 2 threads writing to the same pipe/socket without a sync/mutex. I 
send a reference to a C++ object back to the main thread for processing.

________________________________________
From: Sergey Lyubka [mailto:[EMAIL PROTECTED] 
Sent: quarta-feira, 28 de Maio de 2008 18:05
To: Rui Jorge Coelho
Cc: shttpd-general
Subject: Re: [shttpd-general] Accept callback: threads and pipes


On Wed, May 28, 2008 at 4:38 PM, Rui Jorge Coelho <[EMAIL PROTECTED]> wrote:
* If you pass the same pointer to all callbacks them how do I choose which the 
pipe to use? or are you assuming all worker threads write back to the same pipe 
(doesn't work without sync/mutex)?

 main thread ----- pipe1 ----- worker thr1
   |
   |------ pipe2 --- worker thr2

Okay, lets take a closer look at this. You say that every worker must have it's 
own pipe to the main program. Again, why? Both in worker 1 and worker 2 can be 
many connections, so many callbacks, writing simultaneously to the pipe, so how 
is it different of having just one pipe or several?


-------------------------------------------------------------------------
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

Reply via email to