[Top][All Lists]

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

Re: [libmicrohttpd] Connection timeout notification callback; Dynamicall

From: Christian Grothoff
Subject: Re: [libmicrohttpd] Connection timeout notification callback; Dynamically changing thread pool
Date: Fri, 12 Feb 2010 08:46:56 +0100
User-agent: KMail/1.12.4 (Linux/2.6.32-trunk-amd64; KDE/4.3.4; x86_64; ; )

On Thursday 11 February 2010 15:19:25 John Lee wrote:
> I have two questions:
> 1) Is it possible to for my app to receive a notification when MHD has
>  timed out on a connection? At the moment my app also needs to duplicate or
>  maintain timestamp for connection timeout.

Yes, use MHD_OPTION_NOTIFY_COMPLETED (and expect a MHD_RequestTerminationCode 

> 2) I'm using MHD_USE_SELECT_INTERNALLY and specifying a thread pool. Is it
> possible to dynamically change the number of threads based on my loading
> conditions? Would it even make sense to do this, in that does one see a
> performance improvement by throwing more threads into the mix?

Depends on what you mean by dynamically.  You can change the number of threads 
in the pool by passing a different value to MHD_daemon_start.  So if you  
out how many cores you have before that call, you should be able to 
dynamically adjust to the "perfect" number of threads (which is likely #cores 
or #cores/2).



reply via email to

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