[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Thread-unsafe initialization problems in Guile
From: |
Mark H Weaver |
Subject: |
Re: Thread-unsafe initialization problems in Guile |
Date: |
Thu, 28 Feb 2013 16:07:14 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.2 (gnu/linux) |
Here's an article from a reputable source that backs up my claim that
the lazy-initialization pattern that we use in a few places is not
thread-safe:
http://www.ibm.com/developerworks/java/library/j-dcl/index.html
Here are the thread-unsafe lazy initializations that I'm aware of:
./posix.c:1375: make_rw_port = scm_c_private_variable ("ice-9 popen",
./debug.c:217: local_eval_var = scm_c_public_variable ("ice-9 local-eval",
"local-eval");
./strports.c:541: eval_string = scm_c_public_lookup ("ice-9 eval-string",
"eval-string");
In each of these cases, we have two options: (1) synchronize on every
access of the lazily-initialized variable (including reads), or (2)
abandon lazy initialization.
Thoughts?
Mark
- Re: Thread-unsafe initialization problems in Guile,
Mark H Weaver <=