From: Vladimir T. <vtz...@gm...> - 2014-03-12 21:40:12
|
On Wed, Mar 12, 2014 at 11:05 PM, shashank <sha...@gm...> wrote: > I have a few question to ask: > 1. How does the program interact with lisp and c while building it? Can you clarify? > 2. What is NOT thread-safe in CLisp? vs what is thread-safe in clisp? > 3. Is there a list of things that is known to be threadsafe ? As wikipedia states: A piece of code is thread-safe if it only manipulates shared data structures in a manner that guarantees safe execution by multiple threads at the same time. We may argue what is "safe execution" so let's narrow it to: clisp does not crash/segfault. Having this 'definition' I may say that most of the clisp runtime is thread safe - clisp will not crash but depending on the access patterns you may not always get what you expect unless synchronisation primitives are used (mutexes and exemptions). Hashtables are the only (known to me) standard datatype that causes segfaults when manipulated from multiple threads. > 4. The project page says "Finish a multi-threading interface", so what all > things am I looking into working with? > Is it just how clisp is built or is it also related to the internal > workings of clisp. Hashtable implementation should not cause segfaults when accesses from multiple threads. There are two approaches: A. using sync primitives (SBCL has/had this) B. using lock free implementation (ClozureCL has implementation). IMO, both ways require more or less same efforts to be implemented but the latter is more 'scalable'. > 5. Should I brush up my lisp? since i guess I will need to work with lisp > code. Most of the work should be done in plain old C. > All in all, can you guys narrow me down as to what I will be working on? Roughly: lock free hash table that is drop in replacement of current implementation :). Note that there are also weak hashtables: http://clisp.org/impnotes/weak.html#weak-ht Vlad |