[Ecls-list] latest CVS doesn't not build with MT

Juan Jose Garcia Ripoll lisp at arrakis.es
Mon Oct 24 04:17:17 UTC 2005


On Thu, 2005-10-20 at 11:22 +1000, Dean O'Connor wrote:
        
        > FYI ... as a test, I can call this function from my main thread, it 
        > doesn't crash.
        > 
        >     ecl_import_current_thread(Cnil, Cnil);
        > 
        > But still calling it from only from my worker threads still crashes.
        > That call was the first line of worker threads
        
        Sorry for the delay, but this required some investigation. Basically I
        found two problems
        
        1) There was some bug in the implementation of si_make_process(), which
        assumed that the thread had already been imported and sometimes worked
        sometimes did not.
        
        2) I discovered that one has to create the threads using ECL's wrappers
        on top of either posix/windows threads. It is not really needed to
        change your code, but the application that creates the threads has to
        include <ecl.h> in order to get the calls
        pthread_create()/CreateThread() replaced with the ones that the garbage
        collector supplies. Otherwise garbage collection may fail on the
        imported threads.
        
        I supply a couple of files with an example of how to do it under linux.
        I did not have time to prepare the Windows version, but it should be
        a trivial translation.
        
        Regards,
        
        Juanjo
-------------- next part --------------
A non-text attachment was scrubbed...
Name: foo.c
Type: text/x-csrc
Size: 1852 bytes
Desc: 
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20051024/32bf9bf1/attachment.c>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Makefile
Type: text/x-makefile
Size: 80 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/ecl-devel/attachments/20051024/32bf9bf1/attachment.bin>


More information about the ecl-devel mailing list