[Ecls-list] Proposed diff against CVS HEAD related to threads

Matthew Mondor mm_lists at pulsar-zone.net
Fri Jun 19 22:40:57 UTC 2009


Hello,

I've been looking at ECL lately and find the project interesting.
Moreover, it looks promising for use with threads on NetBSD on which
clisp lacks the native compilation features and SBCL lacks threading
support (which is still linux-centric using futexes for instance).
ECL is also better than SBCL when needing to produce executables (SBCL
produces huge ones and they are not very stable).
Thanks for the great work!

I propose the following diff against CVS HEAD to fix the following
issues:

- According to POSIX, threads created using the default attributes must
  be joined for their return result to be obtained and their resources
  freed.  This means that an implementation may even leak full thread
  stacks if they're not joined.  However, it's possible to set the
  detachstate to PTHREAD_CREATE_DETACHED meaning that we will not join
  the thread; we can then safely expect its resources to be
  automatially reclaimed when the thread terminates.

- Attribute objects may safely be initialized in advance allowing
  cleaner and more optimized code.  Moreover, it is not necessary to
  create an attribute object if the default behavior is wanted, where
  NULL can be passed.

- On NetBSD, the _NP suffix to some macros caused building errors.
  These few cases where also fixed in this diff; this might require
  addition of preprocessor conditionals for some systems, perhaps.

These changes were initially applied and tested on ECL 8.12.0 for my
own use, but this diff was adapted for the current code.

Thanks,
-- 
Matt




More information about the ecl-devel mailing list