Origin Ver.: 8.6 Pro SR3
Operating System: WinXp
I'm doing a lot of data fitting, so I'd like to speed up things by spreading the work to all of my four processor cores.
OriginC documents the createthread() function, but doesn't give any example. I've been trying with the code below. But so far I'm only getting two segmentation faults when calling start().
Has anybody succeeded in starting multiple threads?
#include <Origin.h>
#include <mswin.h>
DWORD WINAPI funcw(LPVOID lpParam)
{
for (int j=0;j<1000000;j++) {
// Wasting some time...
}
return 0;
}
void start() {
HANDLE h[2];
DWORD id[2];
for (int i=0;i<2;i++) {
CreateThread(NULL,0,funcw,NULL,0,&id[i]);
}
}