[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Locks and threads
From: |
Linas Vepstas |
Subject: |
Re: Locks and threads |
Date: |
Wed, 25 Mar 2009 22:40:16 -0500 |
2009/3/25 Neil Jerram <address@hidden>:
> #2 makes the symbols hash thread-safe, and it appears that this
> completely fixes the define-race problem.
I reviewed patch2 as best I could, but I'm cross-eyed
cause its late at night, and I don't know guile internals
well. So I'm not sure my review means much. However,
isn't the following a mem leak:
+static SCM
+intern_symbol (SCM symbol, const char *name, size_t len, size_t raw_hash)
+ /* Allocate new cell and bucket before locking the mutex. */
+ new_bucket = scm_acons (symbol, SCM_UNDEFINED, SCM_BOOL_F);
+ for (l = slot; !scm_is_null (l); l = SCM_CDR (l))
...
+
+ scm_i_pthread_mutex_unlock (&symbols_mutex);
+ return sym;
it looks to me like new_bucket is never released.
I assume that the scm_acons did a malloc, but
maybe not
I'm to tired to say anything meaningful about the rest ...
--linas
p.s. many thanks for chasing this stuff down and fixing it !
It is all a very pleasant surprise!
- Re: Locks and threads, (continued)
- Re: Locks and threads, Neil Jerram, 2009/03/10
- Re: Locks and threads, Neil Jerram, 2009/03/11
- Re: Locks and threads, Neil Jerram, 2009/03/11
- Re: Locks and threads, Linas Vepstas, 2009/03/11
- Re: Locks and threads, Clinton Ebadi, 2009/03/11
- Re: Locks and threads, Neil Jerram, 2009/03/25
- Re: Locks and threads, Linas Vepstas, 2009/03/25
- Re: Locks and threads, Andy Wingo, 2009/03/12
- Re: Locks and threads, Neil Jerram, 2009/03/13
- Re: Locks and threads, Neil Jerram, 2009/03/25
- Re: Locks and threads,
Linas Vepstas <=
- Re: Locks and threads, Neil Jerram, 2009/03/26
- Re: Locks and threads, Linas Vepstas, 2009/03/26
- Re: Locks and threads, Ludovic Courtès, 2009/03/26
- Re: Locks and threads, Neil Jerram, 2009/03/26
- Re: Locks and threads, Ludovic Courtès, 2009/03/26
- Re: Locks and threads, Neil Jerram, 2009/03/26
- Re: Locks and threads, Linas Vepstas, 2009/03/26
- Re: Locks and threads, Ludovic Courtès, 2009/03/14
- Re: Locks and threads, Andy Wingo, 2009/03/16
Re: Locks and threads, Neil Jerram, 2009/03/25