[Ecls-list] Special symbols that might benefit from implicit locking or thread-local bindings
Matthew Mondor
mm_lists at pulsar-zone.net
Mon Aug 1 03:32:15 UTC 2011
Hello again,
I audited the symbol.d and package.d code today, and wrote down some
notes about possible future improvements. Some things have to do
with locking, and since we were already on that topic earlier:
Although GENSYM is more often used in the compile phase (which is
single-threaded, at least for now), it can also be used by
multithreaded user code at runtime. Because GENSYM is standard,
it's unlikely that user code would expect to have to use a lock to
avoid its internal race conditions around *GENSYM-COUNTER*. So
possibly that GENSYM should implicitely use a lock, held the whole time
between the getf and setf.
I wondered if a lock was also required for *PACKAGE* access in
IN-PACKAGE, but I'm unsure, as theoretically every thread has its own
local *PACKAGE*; but I'm unsure where this binding gets created, I only
see the ECL_SETQ to set the new package, I might have missed a LET-like
binding creation operation. I see a ecl_bds_bind() call for
*current-process* only in process.d. There's some bindings related
code in process_alloc() but I don't think it handles this either.
Thanks,
--
Matt
More information about the ecl-devel
mailing list