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

From: Todd Lyons <>
Date: Thu, 1 Dec 2011 08:10:04 -0800

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.

> 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

"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 /

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

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
If Americans could eliminate sugary beverages, potatoes, white bread,
pasta, white rice and sugary snacks, we would wipe out almost all the
problems we have with weight and diabetes and other metabolic
diseases. -- Dr. Walter Willett, Harvard School of Public Health
Received on Thu Dec 01 2011 - 16:10:13 PST

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