Thread overview
multi thread
May 15, 2005
Michael
May 18, 2005
Walter
Re: Re: multi thread
May 20, 2005
Michael
May 15, 2005
How can I compile a multi thread program? Like this:

#include <cstdio>
#include <process.h>
void thread1(void* pVoid)
{
for(int i = 0; i < 100; i++)
printf("thread1\n");
}

void thread2(void* pVoid)
{
for(int i = 0; i < 50; i++)
printf("thread2\n");
}

int main()
{
_beginthread(thread1, 0, 0);
_beginthread(thread2, 0, 0);
return 0;
}

When compiling: dmc multithread
it prints:
_beginthread(thread1, 0, 0);
^
Error: undefined identifier '_beginthread'
errorlevel 1


May 18, 2005
_beginthread is defined in \dm\include\process.h. I'd check your INCLUDE and other settings to see if perhaps you've got another process.h somewhere that is being #include'd instead.


May 20, 2005
In article <d6ea69$16t6$2@digitaldaemon.com>, Walter says...
>
>_beginthread is defined in \dm\include\process.h. I'd check your INCLUDE and other settings to see if perhaps you've got another process.h somewhere that is being #include'd instead.
>
>
I tried to use the absolute path (#include "E:\DigitalMars\include\process.h"), but the problem remained. By the way, does dmc compile the source code into a multithread program by default? No flags needed?