Re: help on building clisp

Vladimir Tzankov <[email protected]>
Newsgroups gmane.lisp.clisp.devel
Message-ID <CAHWYE6JOF-_tf-Y=pEUcJXg_LELRyPE-TeWif9fvTMyzxQC0Lw@mail.gmail.com>
On Wed, Mar 12, 2014 at 11:05 PM, shashank <[email protected]> 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

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
clisp-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/clisp-devel
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.