Re: multithreaded environment ? (better now: multi-core environment)

From: Frank Gadegast <>
Date: Thu, 01 Dec 2011 17:21:12 +0100

Todd Lyons wrote:
> On Thu, Dec 1, 2011 at 7:18 AM, Frank Gadegast<> wrote:
>> Specially when most other processes (sendmail or spamassassin) are
>> running on all virtual CPUs ...
> both of which fork.

and because its nearly impossible to have a libmilter that
supports forking, why not having a opendkim-milter thats
support forking to single opendkim-processes like spamd-milter does ?

Probably much easier to implement (if someone will copy the code
from spamd-milter ;o)

Kind regards, Frank

>> Its only using 1/16 of the possible performance on our system.
>> So, why is there no (or is there ?) a opendkim-milter that will
>> call several processes of opendkim running on several CPUs ?
> It seems you would need to modify libmilter to use a forking model
> instead of a threading model. Or maybe a different threading model
> will use true os/kernel threads instead. From a conversation on Stack
> Overflow:
> "For example, Ruby's default threading implementation doesn't use true
> OS / kernel threads. Instead it mimics having multiple threads by
> switching between the Thread objects within a single kernel thread /
> process.
> This is important on multiprocessor / multi-core systems, because
> these types of lightweight threads can only run on a single core - you
> don't get much in the way of performance boost from having multiple
> threads."
> That is pretty clear. It seems that the pthread library which
> libmilter uses is mimic'ing threading as opposed to true threading.
> But I'm speaking of concepts outside of my knowledge, so take my
> comments with a grain of salt.
> I don't know if it's possible to mix forking with threading in the
> same app. I would think not.
> Regards... Todd

PHADE Software - PowerWeb             
Inh. Dipl.-Inform. Frank Gadegast   
Schinkelstrasse 17                                fon: +49 33200 52920
14558 Nuthetal OT Rehbruecke, Germany             fax: +49 33200 52921
Public PGP Key available for
Received on Thu Dec 01 2011 - 16:21:46 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:20:22 PST