[Ecls-list] multi-threaded C++ app

Dean O'Connor dean.oconnor at ite.com.au
Wed Oct 12 01:19:13 UTC 2005


Hello

I am still trying to understand what is currently possible with 
Multithreading.

I can use the Lisp internal threads/processes basically ok.

We would like to be able to have a C++ thread pool in a C++ application, 
call a lisp script for extended functionality on the same thread.
The C++ app would provide callback functions via cl_def_c_function that 
could return foreign data (for reading the apps internal data structures).
These callback functions would use native C++ mutexes to protect common 
data.

I have previously seen comments in the mail-list about importing the 
thread state from the C++ application and mention of a C function that 
could be easily written for it.
(ps. The mail-list search flakes out and returns empty docs quite a bit 
for me ... so I get those old comments at moment)

Is this possible now ? If so, does anybody have any examples or doco 
specifically on this ?

I guess our alternative is to keep our C++ app single threaded and 
generates a Lisp thread pool.
But if we call those callback functions, would the C++ mutex's there 
work as they should ?
ie. is calling from Lisp thread considered a different C++ thread and 
the mutex properly block other Lisp threads calling the same callback 
function ?

Sorry if this is confusing ....

Cheers for any help

Dean




More information about the ecl-devel mailing list