[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Guile-commits] GNU Guile branch, wip-nj-thread-safety, created. release
From: |
Neil Jerram |
Subject: |
[Guile-commits] GNU Guile branch, wip-nj-thread-safety, created. release_1-8-6-37-gd460681 |
Date: |
Sat, 08 Jan 2011 11:25:13 +0000 |
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GNU Guile".
http://git.savannah.gnu.org/cgit/guile.git/commit/?id=d460681c796139d904b42c7a378f3964b453daf6
The branch, wip-nj-thread-safety has been created
at d460681c796139d904b42c7a378f3964b453daf6 (commit)
- Log -----------------------------------------------------------------
commit d460681c796139d904b42c7a378f3964b453daf6
Author: Neil Jerram <address@hidden>
Date: Wed Mar 25 22:52:01 2009 +0000
wip
commit 7627abf6ecf1770367ea2c5f8d61e14fa4843c8a
Author: Neil Jerram <address@hidden>
Date: Wed Mar 25 22:50:46 2009 +0000
Allow non-weak hash tables to be automatically thread-safe
This patch allows a fat mutex to be associated with a hash table.
When a hash table has an associated mutex, that mutex will be
automatically locked and unlocked around all operations (include
lookups) on the hash table's internal data.
* libguile/hashtab.c (make_hash_table): Init mutex field to #f.
(hashtable_mark): New function.
(scm_hash_fn_get_handle, scm_hash_fn_create_handle_x,
scm_hash_fn_remove_x, scm_hash_clear_x, scm_internal_hash_fold,
scm_internal_hash_for_each_handle): If the hash table has a mutex,
lock and unlock it around all accessing of the hash table's
internals.
(scm_hash_use_mutex_x): New function.
(scm_hashtab_prehistory): Use hashtable_mark as hash table mark
function.
* libguile/hashtab.h (SCM_HASHTABLE_MUTEX, SCM_SET_HASHTABLE_MUTEX,
scm_hash_use_mutex_x): New declarations.
(scm_t_hashtable): New mutex field.
commit 7b6b81cfef3705d20715b978b51004a8c4a6ddf6
Author: Neil Jerram <address@hidden>
Date: Wed Mar 25 22:34:23 2009 +0000
Make the interned symbols hash thread-safe
These changes introduce a mutex that protects all accesses to and
modifications of the symbols hash. They allow the test-define-race
test to run without errors for a long time. (Well, for 200s anyway.)
* libguile/environments.c (obarray_enter, obarray_replace): Extra
parameter on scm_i_rehash calls.
* libguile/hashtab.c: Include symbols.h.
(scm_i_rehash): New mutex parameter. When non-NULL, unlock and
relock this mutex around allocations, and recheck new size
calculation (in case another thread has changed it).
(rehash_after_gc): Special treatment for the symbol hash.
(scm_hash_fn_create_handle_x, scm_hash_fn_remove_x): Extra parameter on
scm_i_rehash calls.
* libguile/hashtab.h (scm_i_rehash): New mutex parameter.
* libguile/symbols.c (symbols): Rename scm_i_symbols and make non-static.
(symbols_mutex): New variable.
(scm_sys_symbols): symbols -> scm_i_symbols.
(lookup_interned_symbol): Lock symbols_mutex while performing lookup.
(intern_symbol): Add name, len and raw_hash parameters. Lock
symbols_mutex while checking and modifying the symbols hash. Once
the mutex is locked, recheck in case another thread has already
interned the symbol. Return interned symbol, in order to tell
callers about this last case.
(scm_i_c_mem2symbol, scm_i_mem2symbol, scm_take_locale_symboln):
Update intern_symbol calls.
(scm_i_rehash_symbols_after_gc): New function.
(scm_symbols_prehistory): symbols -> scm_i_symbols. Initialize
symbols_mutex.
* libguile/symbols.h (scm_i_symbols, scm_i_rehash_symbols_after_gc):
New declarations.
-----------------------------------------------------------------------
hooks/post-receive
--
GNU Guile
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Guile-commits] GNU Guile branch, wip-nj-thread-safety, created. release_1-8-6-37-gd460681,
Neil Jerram <=