unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
* Using define in multiple threads?
@ 2008-11-16 22:27 Linas Vepstas
  2008-11-17 13:18 ` Han-Wen Nienhuys
  0 siblings, 1 reply; 8+ messages in thread
From: Linas Vepstas @ 2008-11-16 22:27 UTC (permalink / raw)
  To: guile-devel

Is it "safe" or "legal" to use define in multiple threads?

I am currently looking at an infinite loop in guile, it looks
like there's a pair with cdr pointing to itself.  The pair is
a hashtable bucket. I'm reading through hashtab.c
and see no locking at all, and so it seems probable that
this circular bucket list was created in a race between
two threads inserting into the same hash table.

Now, the test case which triggers this does nothing
other than defines --  it loads a set of files, one per thread,
and, for good measure, I reloaded these over and over.
So typically, one will have the same function being
redefined over and over, typically in different threads.
The same function might be getting defined "simultaneously"
in different threads, even.

So-- I was assuming that this would be an inherently
"safe" operation ... but maybe its not? Is there some funky
semantics to define in a multi-threaded environment?

--linas




^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2008-11-20  8:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2008-11-19 23:36         ` Neil Jerram
2008-11-19 23:45           ` Andy Wingo
2008-11-20  8:33             ` Ludovic Courtès

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).