- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have been wondering about this function. How much processing time is taken when this function is called?
Specifically:
How much faster is this at setting variable to 1:
int variable = 0;
int main()
{
variable = 1;
return 0;
}
Than this:
int variable = 0;
LRESULT WINAPI ThreadProc(LPVOID lpParameter)
{
variable = 1;
return 0;
}
int main()
{
DWORD dwThreadID;
CreateThread(0,0,ThreadProc,0,&dwThreadID);
while(variable==0) {Sleep(10);}
return 0;
}
Thanks,
-Steve
Specifically:
How much faster is this at setting variable to 1:
int variable = 0;
int main()
{
variable = 1;
return 0;
}
Than this:
int variable = 0;
LRESULT WINAPI ThreadProc(LPVOID lpParameter)
{
variable = 1;
return 0;
}
int main()
{
DWORD dwThreadID;
CreateThread(0,0,ThreadProc,0,&dwThreadID);
while(variable==0) {Sleep(10);}
return 0;
}
Thanks,
-Steve
Link Copied
0 Replies
Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page