guile-devel
[Top][All Lists]
Advanced

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

Re: Redoing conditional thread support


From: Marius Vollmer
Subject: Re: Redoing conditional thread support
Date: 12 Oct 2002 00:49:57 +0200
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2

Neil Jerram <address@hidden> writes:

> >>>>> "Marius" == Marius Vollmer <address@hidden> writes:
> 
>     Marius> This should make it easier to write code that is thread
>     Marius> aware but doesn't require threads, like the thread-aware
>     Marius> sigaction function.
> 
>     Marius> Objections?
> 
> Not really, but I'm not sure that this motivation makes sense in
> detail, because we could (I think) provide a null implementation like
> this in Scheme:
> 
> (define-module (ice-9 thread-api-even-if-no-threads))
> 
> (or (defined? 'try-mutex)
>     (define (try-mutex m) #t))
> etc.

That's what I plan to do, in essense.  I want to do it on the C level,
tho, so that C code can just pretend that there is always the concept
of threads and doesn't need to special case when Guile is configured
without real thread support.

The thing is mostly finished, but I got a bit over-ambitious and
implemented almost-real-mutices since Tom made me see that asyncs
could be used to have some kind of cooperating concurrency and so even
without real threads you might want to have mutices and condition
variables, etc.  Something to make a real thread head writhe, I'm
afraid.

> But perhaps there are other benefits?

We can get rid of USE_THREADS and some code will become cleaner and
easier to maintain.

-- 
GPG: D5D4E405 - 2F9B BCCC 8527 692A 04E3  331E FAF8 226A D5D4 E405




reply via email to

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