[Cbc] thread safety

John Forrest john.forrest at fastercoin.com
Thu May 15 03:13:28 EDT 2014


Alon,

In December I made some changes to make using CbcMain0/1 threadsafe - 
this is what I posted.

John Forrest
-------------
Cornelius,

I have made some changes, which I hope will be enough for you. I have 
done the minimum amount of work.

I don't think they can hurt anyone but as Ted Ralphs is preparing a new 
release, I will delay updating Cbc/stable/CbcSolver.?pp for a day or 
two. If anyone wants to test the code I attach CbcSolver.?pp.

You need to compile with -DCBC_THREAD_SAFE. The main thing this does is 
that Cbc only reads argv/argc type parameters in a crude threadsafe way. 
You also need to use alternative versions of CbcMain0/1.

parallel.cpp has been added to Cbc/examples which is a simple example.

Please tell me if there are any problems. Some lesser used Cgl cut 
generators may not be threadsafe, but I think the commonly used ones are.

John Forrest


On 17/12/13 15:11, Cornelius Riemenschneider wrote:
>
> Hello,
>
> we use CBC via googles or-tools from java in our application.
>
> Compared to scientific problems, our problems are small and solved by 
> Cbc in <1s (which is great!).
>
> As we process requests from users concurrently, we’d also like to call 
> Cbc concurrently.
>
> Currently, this is impossible, because Cbc uses the static parameters 
> array in CbcMain0 and CbcMain1 and thus crashes or reads incorrect 
> parameters.
>


More information about the Cbc mailing list