memcached posix threads and pidfile problem

Marlon de Boer marlon at
Tue Oct 9 14:50:42 UTC 2007

Hi list,

I had some troubles running a threaded memcached with -P, see for details.

After looking at the source I noticed the writing of the pid happens
after the daemon starts it threads, resulting in multiple threads
wanting to write to the same file pointer. I've solved this with a patch

>       save_pid(getpid(), pid_file);
<     /* save the PID in if we're a daemon */
<     if (daemonize)
<         save_pid(getpid(), pid_file);

Kind regards,


More information about the memcached-commits mailing list