Re: Dead code found, some questions and suggestions
Vladimir Tzankov <[email protected]>
| Newsgroups | gmane.lisp.clisp.devel |
|---|---|
| Message-ID | <CAHWYE6+MkbBh+EjahDS6ft1BXp_gV52_8FDaYOp2BAd64SB1oA@mail.gmail.com> |
On Mon, Jun 19, 2017 at 1:40 PM, Compro Prasad <[email protected]> wrote: > > 4) I was considering to provide each symbol with a mutex so that they > could be > locked when any function tries to change the value of the symbol. And > this > has to be done in the function itself. For example, if > struct symbol_ > { > /* other contents */ > xmutex_raw_t mut; > } > is the definition of a symbol_ then mut can be used to lock it for > writing > purposes or even deletion too. > 1. How is this change related to hash tables? Such mutex may guard changes in symbol record but I guess your intention is to serialize modifications of the object pointed by symbol value cell. Symbols A and B value cells may point to same object which is not guarded in any way by the above mutex. I think you should limit you scope to hashtabl.d and Hashtable struct. 2. Don't use xmutex_t or xmutex_raw_t in records. These won't be properly restored during image loading. Instead use 'normal' lisp mutex objects - see Package struct for an example. ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ clisp-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/clisp-devel