Race Condition
- To: mathgroup at smc.vnet.net
- Subject: [mg17007] Race Condition
- From: rmille1 at aol.com (RMille1)
- Date: Sat, 10 Apr 1999 02:13:38 -0400
- Organization: AOL http://www.aol.com
- References: <7ek3g3$n58$1@dragonfly.wolfram.com>
- Sender: owner-wri-mathgroup at wolfram.com
You mentioned a race condition. What exactly does this look like? I'm using the kernel to send a string to convert to an expressiom and evaluate, then I'm letting MLNextPacket() block until returns. I did notice that doing this was causing the kernel to launch a massive number of threads. Over a hundred in some cases. However, if I checked MLReady() before calling MLNextPacket(), then called the Windows function Sleep() to idle my code for 1/2 second, the thread count from the kernel stayed under 10. >I have with this is that the kernel does not answer in the same manner when >waiting for input or evaluating. I do not know how to avoid a race conditions >that may occure. Also depending on how you start the kernel the MLPutMessage >works or fails-see another of my posts to the newsgroup (it's recent, so it >should still be there). > >Hope this helps Tobias >