The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Multithreading in originc

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
isteiner Posted - 10/26/2012 : 05:49:34 AM
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]);
	}
}
6   L A T E S T    R E P L I E S    (Newest First)
yuki_wu Posted - 09/27/2018 : 01:38:35 AM
Hi,

I am sorry that the current version of Origin still doesn’t support multi-thread.

Origin provides embedded Python support now. You may try to use the feature of multi-thread that Python supports in Origin if you are interested in this topic.

Regards,
Yuki

OriginLab
MultiThread Posted - 03/23/2015 : 09:56:09 AM
Are there any news about multiple threads?
Any chance to do it?
JessieWoo Posted - 11/02/2012 : 03:40:44 AM
Hi,

Sorry that I have just double checked with our developer, Origin does not support multi-thread yet. This function does not work well with Origin.

Best Regard,
Jessie
Originlab Corp.
isteiner Posted - 10/30/2012 : 06:35:05 AM
To give it another try, I copied the code to Visual Studio.
There I can start several threads without any problem.

When I step through the code in the Origin debugger so slowly, that the first thread exits before the second one starts, I don't get any error.

I suppose there must be some bug in Origin, that causes the crash, when several threads are executing in parallel, even if they don't access any shared data.

Regards,
Ingo
isteiner Posted - 10/30/2012 : 04:20:48 AM
Thanks for your reply, Yessie.

But link to the example goes nowhere!
Could you please check the microsoft website.

Regards,
Ingo
JessieWoo Posted - 10/30/2012 : 04:14:20 AM
Hi,

OriginC: createthread() function is a windows API. You can refer to the example below provided by Microsoft.
http://msdn.microsoft.com/en-us/library/windows/desktop/ms682516(v=vs.85).aspx

Best Regard,
Jessie
Originlab Corp.

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000