[Ecls-list] Accessing C variables

Goffioul Michael goffioul at imec.be
Thu Oct 6 00:35:14 UTC 2005


> Hello again,
> 
> I have managed to access my C-strings quite well using FFI, thx.
> 
> Now I wish to delve into the dark side a little ... multi-threading.
> There is basically nothing in the doco regarding this.
> I have searched thru this forum archive and found a few hits on this 
> topic. Some seem to indicate crossing the windows and lisp threads is 
> not possible ??
> 
> Can you please give me any more information on the 
> status/stability of 
> multi-threaded for windows and linux ?
> 
> We have a C++ application that processes trade data. Each trade is 
> basically broken down into a map of name/value string pairs (in C++).
> We have lisp scripts that will anaylse each trade and call back 
> predefined C++ functions with actions to perform.
> The two functions F_var and emit_portfolio I have included below give 
> you some idea how we access C++ variables and perform actions 
> respectively. (prob not the best way :)
> 
> The tricky part is that at the moment we only do one trade at a time, 
> and this should pose no problem. But we wish to process a number of 
> trades concurrently to improve performance.
> Each trade will be processed in its own C++ thread. I plan 
> for each C++ 
> thread to call the same lisp rule script.
> We will add further C++ mutexing around our datastructures used in 
> functions below, but I am concerned that this approach is 
> going to work 
> at all with what I have read so far !!
> 
> Does anyone have any examples of this kind of multithread approach ?
> To what extent is ECL threadsafe ?
> Any ideas on other approaches, like using Lisp threading solely ??

Basic documentation about multithread support in ECL can be found at
http://ecls.sourceforge.net/cgi-bin/view/Main/MultiProcessing

> PS: one side note. When I compile ELCS (from CVS - now 
> version H) with 
> multithreading on windows (using MS VC 6), the ecl.exe is not 
> produced, 
> only the ecl_min.exe ? Any reason in particular ?

Some linking probably fails. Look for any relevant error message during
compilation, especially during linking steps. It's been a while since
I compile with MT support.

Michael.





More information about the ecl-devel mailing list