gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] GNU Go as an oracle


From: Dave Denholm
Subject: Re: [gnugo-devel] GNU Go as an oracle
Date: 07 Nov 2002 10:26:05 +0000

Arend Bayer <address@hidden> writes:

> Trevor Morris wrote:
> 
> > Is there a standard cross-platform way of:
> >  - starting threads in the same process (rather than forking a new one)?
> 
> I don't think so. On GNU/Linux, there is clone(2) (the system call to
> the kernel), and pthread_create(3), as far as I understand a wrapper
> around clone in the glibc.
> 

pthreads is the posix threads package. There are various implementations
for linux and win32, so that would probably be the most portable approach.
And of course solaris, hpux, aix etc offer pthreads. Don't know about macos.

At least one of the implementations of pthreads on linux uses clone(),
but it isn't strictly conforming to the posix standard. It is usually good
enough for most applications, though. There are other pthreads libraries around
which are entirely user mode.


However, FWIW, my own experience is that introducing threads always makes things
over-complicated. It is very difficult to get threaded programs correct.

Eg if we start a thread to look ahead, we have to be able to terminate
it. Which means we need some sort of handshake to make the main thread
know when the helper has terminated etc.

On unix, this is a lot easier to manage with a child process. Unfortunately
that's not portable, of course.


dd
-- 
address@hidden          http://www.insignia.com




reply via email to

[Prev in Thread] Current Thread [Next in Thread]