Multiple threads using Mathlink
- To: mathgroup at smc.vnet.net
- Subject: [mg88775] Multiple threads using Mathlink
- From: Paweł Banasik <p.banasik at students.mimuw.edu.pl>
- Date: Fri, 16 May 2008 05:32:16 -0400 (EDT)
Hello, I have a question regarding multithreaded access to Mathematica via MathLink. I'm developing a set of webservices for use with the Taverna Workbench (taverna.sourceforge.net), a computational biology tool. These webservices call Mathematica to perform some computations. Obviously, each webservice invocation creates a new thread. As I'd like the Mathematica environments belonging to different threads to be completely separated one from another, I've implemented a mechanism which creates a new MathLink object for every thread. Unfortunately, this leads to serious problems, including an application service crash, occuring from time to time. Apparently, this is some kind of a concurrent access problem - it doesn't happen when I run only one thread at a time, with subsequent invocations separated by a few seconds. Perhaps there is a problem with my understanding of the relation between MathLink and Mathematica kernels? Is it true that each Mathlink object creates a separate kernel process? If not, how to achieve such behavior? Do the MathLink native libraries support multithreading? Thank you for your help, Regards, Pawel Banasik
- Follow-Ups:
- Re: Multiple threads using Mathlink
- From: Steve Wilson <stevew@wolfram.com>
- Re: Multiple threads using Mathlink