[Ecls-list] Locking strategy (best so far)

Juan Jose Garcia-Ripoll juanjose.garciaripoll at googlemail.com
Fri Apr 6 11:02:16 UTC 2012

On Sat, Mar 31, 2012 at 12:13 PM, Matthew Mondor
<mm_lists at pulsar-zone.net>wrote:

> It appears that it locks before all initial threads of the HTTPd can be
> started.  The REPL doesn't come back while that thread appears to be
> waiting on a pthread_cond_wait(3) forever without getting an event.
> This happens inside the GC, invoked sometime during HTTPD-INIT (that
> happens in the first/main thread):

There were a bunch of problems with the previous code. From a wrong order
in the arguments to pthread_sigmask() to the choice of signals. I have
fixed them together with the following things

* Implemented semaphores
* Implemented barriers (copied part of the API from Lispworks, though I
feel it is overengineered)
* mp:process-join relies on barriers (no trivial thing, the original code
was a mess because of the lack of this tool)
* fixes in external processes, locking, etc.

In particular the changes to mp:process-join are quite critical for ECL
being able to gracefully quit when there are running threads.

I can confirm that I am able to run your server and get decent connection
times, slightly better than on OS X (see below). However, please bear in
mind that I am running this all inside a virtualbox which may improve the
stability, as processors are not really independent, but bound by the

Requests per second:    725.38 [#/sec] (mean)
Time per request:       22.057 [ms] (mean)
Time per request:       1.379 [ms] (mean, across all concurrent requests)
Transfer rate:          452.72 [Kbytes/sec] received


Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20120406/cc3e247d/attachment.html>

More information about the ecl-devel mailing list