From: ludo@gnu.org (Ludovic Courtès)
To: guile-devel@gnu.org
Subject: Re: Using define in multiple threads?
Date: Tue, 18 Nov 2008 11:20:41 +0100 [thread overview]
Message-ID: <87od0dl4hy.fsf@gnu.org> (raw)
In-Reply-To: m34p2684jr.fsf@pobox.com
Andy Wingo <wingo@pobox.com> writes:
> On Mon 17 Nov 2008 15:57, ludo@gnu.org (Ludovic Courtès) writes:
>> Besides, as Linas noted, the hash table implementation isn't
>> thread-safe, which makes it "unsafe" to `define' in parallel.
>
> Ah, this is why, then. I was baffled.
>
> IMO this is a bug; Guile can claim that "wierd behavior is expected"
> when using a data structure from multiple threads in without locking,
> but in this case the data structure is only being used implicitly.
> Modules should contain a lock that is taken when they are mutated.
Right.
I submitted a bug: https://savannah.gnu.org/bugs/index.php?24867 . I'm
not sure whether this can easily be fixed in 1.8, since that would
require adding a mutex to `module-type' and access it from C, which
would break the ABI. Ideas?
> This isn't the first time I've wanted a functional hash table
> implementation...
I wrote long ago an implementation of functional FIFOs and one of
Bagwell's "VLists" [0]; VLists can be used at a building block for "hash
lists", which is a functional data structure akin to hash tables [0].
I've been willing to polish it and push it into Guile for some time, so
if you're motivated, that's even more motivating. :-)
Thanks,
Ludo'.
[0] http://en.wikipedia.org/wiki/VList
next prev parent reply other threads:[~2008-11-18 10:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-11-16 22:27 Using define in multiple threads? Linas Vepstas
2008-11-17 13:18 ` Han-Wen Nienhuys
2008-11-17 14:57 ` Ludovic Courtès
2008-11-17 20:45 ` Andy Wingo
2008-11-18 10:20 ` Ludovic Courtès [this message]
2008-11-19 23:36 ` Neil Jerram
2008-11-19 23:45 ` Andy Wingo
2008-11-20 8:33 ` Ludovic Courtès
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/guile/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87od0dl4hy.fsf@gnu.org \
--to=ludo@gnu.org \
--cc=guile-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).