forum.alglib.net

ALGLIB forum
It is currently Mon Dec 23, 2024 6:51 am

All times are UTC


Forum rules


1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.



Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: multy-threads in alglib.nleqsolver
PostPosted: Sun Oct 21, 2012 2:58 pm 
Offline

Joined: Sun Oct 21, 2012 2:44 pm
Posts: 2
Question about multy-threads in alglib.nleqsolver (C#).
I have two (or more) Backgroundworker-based objects and hence work with two independent threads.
But a delegate - ndimensional_func(double[] arg, ref double func, object obj) - has the "ref" link. My results are sometimes "intersects" because of reference "func" can be common.
Using of two or more references ("alglib2x.dll"...) is impossible in .net, so: is any way to "split" nleqsolver-based calculations?


Top
 Profile  
 
 Post subject: Re: multy-threads in alglib.nleqsolver
PostPosted: Sun Oct 21, 2012 6:55 pm 
Offline
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 927
As long as different threads work with different instances of nleqsolver class, everything is thread-safe. If you want to launch two solvers in parallel, create two instances. Does it solve your problem?


Top
 Profile  
 
 Post subject: Re: multy-threads in alglib.nleqsolver
PostPosted: Sun Oct 21, 2012 7:33 pm 
Offline

Joined: Sun Oct 21, 2012 2:44 pm
Posts: 2
Of course, there two instances were been created... But I found that the reason of the problem was in incorrect boundary (input) parameters transmittion : there were data from public static fields of mainform. When standard object DoWorkEventArgs of the Backgroundworker is used for parameters setup, it works Ok and it is possible to load a multi-core processor. Thanks!


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group