Anyone seen a call to do this?
Any other ideas?
Thanks in advance,
Dimitris.
--
THANOS Dimitris
University of Geneva - CUI
Tel: +41 22 705.76.69
Fax: +41 22 705.77.80
E-mail: mailto://Dimitri...@cui.unige.ch
WWW: http://cuiwww.unige.ch/~thanos
SetThreadAffinityMask
or
SetProcessAffinityMask (NT 4 only, I think)
--
Chris Hill
hil...@cs.purdue.edu
Dimitris Thanos <Dimitri...@cui.unige.ch> wrote in article
<349158CA...@cui.unige.ch>...
> On a multi-processor NT machine, I would like
> to make a program that has two threads, each one running on a different
> processor. This is for obtainning max processing power...
>
Others have answered this with the relevant Win32 calls (not that this
has anything to do with NT kernel mode programming). Let me add a few
comments, however:
1. If no other threads want to run, NT will automatically schedule
your two threads on the two processors with no effort from you.
2. On the other hand, since there are often other threads that want
to run, setting the "hard affinity" of your threads with
SetThreadAffinity can create more performance problems than it solves.
3. You can set a "soft affinity" for your threads with
SetThreadIdealProcessor. This avoids the problems inherent with hard
affinity. But NT already assigns the preferred processor of each
thread in a process to the different processor on a round-robin basis
(with a random starting value for each process), again with no work on
your part.
--- Jamie Hanrahan, Kernel Mode Systems, San Diego CA
Internet: j...@cmkrnl.com (JH645) CompuServe: 74140,2055
drivers, internals, networks, applications, and training for VMS and Windows NT
NT driver FAQ, links, and other information: http://www.cmkrnl.com/
If you post a reply in news, please don't e-mail it too.
The operating system has a scheduler. Let it schedule.
("There's no point in keeping a dog and doing the barking yourself")
dave
--
For email, please remove the 'w' from my address. Sorry.
Dimitris Thanos <Dimitri...@cui.unige.ch> wrote in article
<349158CA...@cui.unige.ch>...
> On a multi-processor NT machine, I would like
> to make a program that has two threads, each one running on a different
> processor. This is for obtainning max processing power...
>
> Anyone seen a call to do this?
>
> Any other ideas?