[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [bug #33996] 2.0.2: Crash related to ports and threads
From: |
Andy Wingo |
Subject: |
Re: [bug #33996] 2.0.2: Crash related to ports and threads |
Date: |
Thu, 18 Aug 2011 11:36:37 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) |
Hi Cedric,
On Fri 12 Aug 2011 09:42, Cedric Cellier <address@hidden> writes:
> (use-modules (ice-9 threads))
>
> (define (forever f)
> (f)
> (forever f))
>
> ; Spawn a thread that performs some writes
> (make-thread forever (lambda ()
> (display "write...\n")))
>
> (forever (lambda () (display "new pipe...\n")))
Oh dear, this is a nasty one. The issue is that Guile's ports are not
threadsafe. I hadn't thought about this one...
I am adding guile-devel to the Cc for input. Any fix to this will be
pretty big, I think. I think that the right fix here is probably what
Glibc does; see `info libc "Streams and Threads"` for the full details.
Basically they add a lock to each FILE*, which is probably what we
should do with our ports. We could investigate Java's biased locking,
if that's useful.
Andy
--
http://wingolog.org/
- Re: [bug #33996] 2.0.2: Crash related to ports and threads,
Andy Wingo <=