Hi! If you're on Linux, this is almost the case, as with a single thread you obviously cannot have lock contention, and you're using a Futex (http://en.wikipedia.org/wiki/Futex) -- so the cost is very close to that of a NOP (no system call). In fact, I would be surprised if replacing the logic with the equivalent of "if (! (daemon->options & MHD_USE_SELECT_INTERNALLY)) lock()" would give you any speed-up (it'd still technically be a branch and not a real NOP).
Anyway, if you have a different reason for asking (other than performance concerns) or have real data showing that there is a difference, please explain more and I'll be happy to listen. Happy hacking! Christian On 06/27/2014 11:18 AM, Martin Velek wrote: > Hello, > > I am using libmicrohttpd with the MHD_USE_SELECT_INTERNALLY flag only > (one thread). Every request is processed in the libmicrohttpd thread > and neither MHD_Connection * nor MHD_Response * are processed outside > the thread. > > Is it possible to make all pthread_mutex_* calls as no-ops? > > Martin >
signature.asc
Description: OpenPGP digital signature
