Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » CPU_Cores() error
CPU_Cores() error [message #14546] Sun, 02 March 2008 17:14 Go to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
Hi,

I have found one or two bugs in the function CPU_Cores() under Win32.

1)
The for loop in the 32 bit version of the function should only run trough 32 times not 64 times.

2)
Shouldn't we use the ProcessAffinityMask instead of the SystemAffinityMask to get the available cores?
Re: CPU_Cores() error [message #14564 is a reply to message #14546] Mon, 03 March 2008 20:11 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kodos wrote on Sun, 02 March 2008 11:14

Hi,

I have found one or two bugs in the function CPU_Cores() under Win32.

1)
The for loop in the 32 bit version of the function should only run trough 32 times not 64 times.



Correct and fixed (but actually not a bug, it worked).

Quote:


2)
Shouldn't we use the ProcessAffinityMask instead of the SystemAffinityMask to get the available cores?



Maybe... Should these be the samein most cases?

Mirek

[Updated on: Mon, 03 March 2008 20:12]

Report message to a moderator

Re: CPU_Cores() error [message #14573 is a reply to message #14564] Mon, 03 March 2008 21:01 Go to previous messageGo to next message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
luzr wrote on Mon, 03 March 2008 20:11


Quote:


2)
Shouldn't we use the ProcessAffinityMask instead of the SystemAffinityMask to get the available cores?



Maybe... Should these be the samein most cases?


I haven't tested it but I think that they are not the same if you assign the process to an explicit processor with the taskmanager.

And I think the return value of this function should return the cores it can use and not the cores that are in the system..
Re: CPU_Cores() error [message #14582 is a reply to message #14573] Tue, 04 March 2008 01:26 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
kodos wrote on Mon, 03 March 2008 15:01

luzr wrote on Mon, 03 March 2008 20:11


Quote:


2)
Shouldn't we use the ProcessAffinityMask instead of the SystemAffinityMask to get the available cores?



Maybe... Should these be the samein most cases?


I haven't tested it but I think that they are not the same if you assign the process to an explicit processor with the taskmanager.

And I think the return value of this function should return the cores it can use and not the cores that are in the system..


Well, we are using "ProcessAffinityMask" now. IMO, that is what you suggest(?)

Mirek
Re: CPU_Cores() error [message #14596 is a reply to message #14582] Tue, 04 March 2008 13:32 Go to previous message
kodos is currently offline  kodos
Messages: 111
Registered: March 2008
Experienced Member
luzr wrote on Tue, 04 March 2008 01:26


Well, we are using "ProcessAffinityMask" now. IMO, that is what you suggest(?)


Yes, thanks.
Previous Topic: Detect connection, valid URL, 404 page
Next Topic: IsFinished() for CoWork
Goto Forum:
  


Current Time: Thu Mar 28 20:01:17 CET 2024

Total time taken to generate the page: 0.00973 seconds