libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [libmicrohttpd] MHD in "worker processes" mode


From: Christian Grothoff
Subject: Re: [libmicrohttpd] MHD in "worker processes" mode
Date: Fri, 10 Jun 2016 23:27:53 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Icedove/38.6.0

On 06/10/2016 09:20 PM, Junker, Gregory wrote:
> On Fri, 2016-06-10 at 13:37 +0200, Christian Grothoff wrote:
>> On 06/10/2016 02:04 AM, silvioprog wrote:
>>>
>>> Hello,
>>>
>>> Please take a look at this question and the first answer:
>>>
>>> http://askubuntu.com/questions/399431/how-many-nginx-processes-shou
>>> ld-there-be
>>>
>>> It raise a question: can I use the worker processes approach with
>>> MHD?
>>> If I understood, it need to up two or more process, but when I try
>>> that:
>>> "Failed to bind to port 8080: Address already in use".
>> You can have a parent process do the binding and then share the
>> listen
>> socket with child processes. Or, you can on most OSes set the binding
>> policy to allow multiple processes to listen to the same socket.
> 
> Interesting, I did not know that was an option. What are the rules
> about which process gets released from a select() or poll in that
> case? 

It's a (benign) race. Statistically speaking, the process that is less
busy ;-).  MHD exploits the same race when multiple threads are in a
thread pool racing to accept on the listen selector in-process.


Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]