Hello. I'm running VC++ .NET 2002 SP1 and creating a quick DOSbox program
to calculate FFT's on data sets. Basically, open data file, load arrays,
compute FFT's on arrays, and write the resultant data to disk.
I have successfully created and am using two threads to simultaneously
compute the FFT's on two processors (dual xeon system). But, I cannot use
the SetThreadIdealProcessor function on my thread handles. I get a compile
error of 'SetThreadIdealProcessor undeclared identifier'. Sometimes
WinXPpro does not schedule the threads properly and they run slowly (as seen
via task manager).
Why is the error occurring because I can see the declaration of the function
in the proper header file? And, yep, I'm using the correct compiler
settings for multithreading...
Any explanations? Should I use SetThreadAffinityMask instead? If so, what
is the format of the mask?
Thanks!
Joe
>Hello. I'm running VC++ .NET 2002 SP1 and creating a quick DOSbox program
>to calculate FFT's on data sets. Basically, open data file, load arrays,
[quoted text clipped - 13 lines]
>Any explanations? Should I use SetThreadAffinityMask instead? If so, what
>is the format of the mask?
From the docs for SetThreadIdealProcessor():
"To compile an application that uses this function,
define the _WIN32_WINNT macro as 0x0400 or later.
For more information, see Using the SDK Headers."
--
Phillip Crews aka Severian
Microsoft MVP, Windows SDK
Posting email address is real
Josef Gonko - 05 Apr 2005 06:39 GMT
Hello and thank you for the response.
I forgot to mention that. I did try placing at the very beginning of my
source file, prior to all the .h includes:
#define _WIN32_WINNT >= 0x0501
#define WINVER >= 0x0501
Which are the values for WindowsXP and I learned this from the
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/winprog/winprog
/using_the_windows_headers.asp
webpage.
Did I do this incorrectly?
Thanks again,
Joe
>>Hello. I'm running VC++ .NET 2002 SP1 and creating a quick DOSbox program
>>to calculate FFT's on data sets. Basically, open data file, load arrays,
[quoted text clipped - 28 lines]
> Microsoft MVP, Windows SDK
> Posting email address is real
Jochen Kalmbach - 05 Apr 2005 07:23 GMT
> Hello and thank you for the response.
>
[quoted text clipped - 3 lines]
> #define _WIN32_WINNT >= 0x0501
> #define WINVER >= 0x0501
Upps...
You must define a *specific* value!
#define _WIN32_WINNT 0x0501
#define WINVER 0x0501

Signature
Greetings
Jochen
My blog about Win32 and .NET
http://blog.kalmbachnet.de/
Josef Gonko - 06 Apr 2005 03:28 GMT
Heya! Thanks! Looks like I got it now... I'm new to multi-threading,
having this new dual xeon system, so thank you for helping me with my
ignorance.
I did have to place the defines between the #include "stdafx.h" and #include
"windows.h" It didn't work if I placed the defines at the very beginning of
the source file. Perhaps stdafx.h remodifies my defines before it gets to
windows.h??
Nonetheless, it compiled just great this time around!
Thanks again. Much appreciated!
Joe
>> Hello and thank you for the response.
>>
[quoted text clipped - 9 lines]
> #define _WIN32_WINNT 0x0501
> #define WINVER 0x0501