🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: SetProcessAffinityMask question.

#10888
From: Eelke Klein
Date: Fri, 19 Mar 2004 09:10
16 lines
1722 bytes
Steve Reece wrote:
> 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.
I haven't ever done this myself but I think something like the following 
will work:

First do a GetProcessAffinityMask. This gives you the current process 
affinity mask and the system affinity mask.
The process affinity mask will tell you on which cpu's the process can 
run. Remove all bits except one and set this as the affinity mask.

Eelke
Technical Details
Message-ID: <405ab940$2@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <405896A4.5E36BFA6@REMOVEcrowneone.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,f1b985c940bfe418
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2004-03-19 01:39:40 PST
Date: Fri, 19 Mar 2004 10:10:27 +0100
From: Eelke Klein <e.klein@mplussoftware.nl>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031007
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: SetProcessAffinityMask question.
References: <405896A4.5E36BFA6@REMOVEcrowneone.com>
In-Reply-To: <405896A4.5E36BFA6@REMOVEcrowneone.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.58.1.162
Message-ID: <405ab940$2@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1079687488 81.58.1.162 (19 Mar 2004 01:11:28 -0800)
Lines: 17
Path: arc1-ca.pugleaf.net!archiver1.google.com!news2.google.com!fu-berlin.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail