From: Dean O'Connor <dean.oconnor@it...> - 2005-10-19 02:24:50
I have just refreshed from CVS and compiled (MSVC 6) with "ECL_THREADS
= 1" and the build fails.
../h\gc_config_macros.h(108) : warning C4005: 'GC_WIN32_THREADS' : macro
unknown(0) : see previous definition of 'GC_WIN32_THREADS'
../../src/c/alloc_2.d(173) : warning C4098: 'ecl_free_uncollectable' :
'void' function returning a v
../../src/c/alloc_2.d(303) : error C2143: syntax error : missing ';'
NMAKE : fatal error U1077: 'cl' : return code '0x2'
NMAKE : fatal error U1077: 'C:\PROGRA~1\MICROS~4\VC98\BIN\NMAKE.EXE' :
return code '0x2'
PS. Any word on "multi-threaded C++ app" thread, where
ecl_import_current_thread is crashing ??
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
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.