Boost logo

Boost :

Subject: Re: [boost] [thread] thread pining (processor affinity)
From: Oliver Kowalke (k-oli_at_[hidden])
Date: 2008-11-18 05:33:23


> k-oli_at_[hidden] wrote:
> > Hello Anthony,
> > are you interessted in a function
> > boost::this_thread::pin_to_processor( int)?
>
> Why not "set_affinity(<some type> processor_mask)"? It's more general and
> uses well-established terminology.

Most systems provide separate system calls for bind to one processor and set processor masks.
So it is reasonable to provide additional functionality for setting the processor masks (not supported by many systems).

> Also, while you're at it, something like this would be valuable to be able
> to specify when creating a thread as well.

Do this only in the ctor is not generic - I saw a lot of code which binds the thread to one processor for some special computations and after finishing unbinding the thread.

Oliver

-- 
"Feel free" - 5 GB Mailbox, 50 FreeSMS/Monat ...
Jetzt GMX ProMail testen: http://www.gmx.net/de/go/promail

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk