🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #10824

SetProcessAffinityMask question.

#10824
From: Steve Reece
Date: Wed, 17 Mar 2004 18:19
15 lines
1545 bytes
I have a multithreaded service.  I am considering purchasing a dual
processor server.  I am not interested in debugging my service for dual
processor right now.  I looked at the help file for
SetProcessAffinityMask but am not sure how to force all the threads onto
a single processor.  


Here is what I would like to do:  For whatever processor the main thread
starts on, force all other threads on to that processor.  Essentially I
want it to run as a single processor application and I do not care which
processor it runs on.

Can anyone post some sample C++ code that will accomplish this?  It
seems to me like it should be easy, but I am stumped.  I am using
C++Builder 5.
Technical Details
Message-ID: <405896A4.5E36BFA6@REMOVEcrowneone.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,f1b985c940bfe418,start
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-03-17 10:23:26 PST
Message-ID: <405896A4.5E36BFA6@REMOVEcrowneone.com>
Date: Wed, 17 Mar 2004 11:19:16 -0700
From: Steve Reece <steve@REMOVEcrowneone.com>
X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: SetProcessAffinityMask question.
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 209.161.2.70
X-Trace: newsgroups.borland.com 1079547599 209.161.2.70 (17 Mar 2004 10:19:59 -0800)
Lines: 15
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!news.linkpendium.com!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail