Author: Robert Hyatt
Date: 10:50:47 07/25/99
Go up one level in this thread
On July 24, 1999 at 22:26:42, Daniel Karlsson wrote: >Try something like: > > pthread_t thread_id; > /* Start UIThread() in a new thread */ > pthread_create(&thread_id, NULL, UIThread, NULL); > /* Do stuff */ > ... > /* Wait for the "UIThread()"-thread to terminate */ > pthread_join(thread_id, NULL); > >and link your program with the pthread library. > >I don't know if this is the correct way but it seems to work OK. The problem with this approach is that _all_ non-local variables are going to be shared between the two threads. Which will most likely wreck things in very bad ways, unless the program is rewritten (I use this approach in Crafty, but you can diff version 15.0 against the last 14.x version to see how significant the changes were...
This page took 0 seconds to execute
Last modified: Thu, 15 Apr 21 08:11:13 -0700
Current Computer Chess Club Forums at Talkchess. This site by Sean Mintz.