[Top][All Lists]

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

Re: [libmicrohttpd] Spawning processes from access handler callback

From: david . myers
Subject: Re: [libmicrohttpd] Spawning processes from access handler callback
Date: Thu, 23 Apr 2015 10:07:17 +0000
User-agent: Roundcube Webmail/1.0.2

>> Locking may help, but this overall sounds like a bad idea for 

>> performance as well. Why not have one thread (or main) globally do the

>> 'ifconfig' fork and cache the result in a (lock-protected) global?

Tried locking with a mutex but it still crashes. There must be something inherently unsafe about forking in an web thread, although I don't see anything wrong with a short system process like 'ifconfig' in a thread-per-connection server.

Anyway, I moved the 'ifconfig' fork to the main thread on a timer, writing the output to a temp file so I can read it in the web thread. This seems stable. Cheers.

reply via email to

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