OpenLisp in multi-threaded environment

General OpenLisp forum

OpenLisp in multi-threaded environment

Postby DmitryG » Sun Nov 13, 2005 5:56 am

Is OpenLisp, especially its memory management subsystem, thread-safe? I suspect only its garbage collector is thread-safe, but other parts are not.
Please, say I'm mistaken :)
DmitryG
 

Re: OpenLisp in multi-threaded environment

Postby jullien » Mon Nov 14, 2005 7:42 am

DmitryG wrote:Is OpenLisp, especially its memory management subsystem, thread-safe? I suspect only its garbage collector is thread-safe, but other parts are not.
Please, say I'm mistaken :)


You're right, GC is the only part using threads.
Otherwise, OpenLisp has a BIG global structure that stores "global" values.
Please note that OpenLisp uses it's own virtual memory manager that
has no chance to conflit with malloc or other allocation routines.
For the internal details, the memory manager uses only mmap or VirtualAlloc on memory it reserves when OpenLisp starts.
Then, it only commits pages on demand in this reserved area.
If malloc occurs, its only from system or C library routines.

Christian
jullien
Site Admin
 
Posts: 30
Joined: Fri Nov 12, 2004 12:29 am

Postby DmitryG » Mon Nov 14, 2005 10:24 am

so, if two threads of a win app, which loads openlisp module, call eg (setq) simultaneously, then there is a probability that openlisp will go into conflict in its own mem management structures?
DmitryG
 

Postby jullien » Mon Nov 21, 2005 7:22 am

DmitryG wrote:so, if two threads of a win app, which loads openlisp module, call eg (setq) simultaneously, then there is a probability that openlisp will go into conflict in its own mem management structures?


Probably yes! as most other Lisp implementation. It should not be very difficult to make exclusive the 4 or 5 places where allocation occurs.
I've no idea of performance penalty.
jullien
Site Admin
 
Posts: 30
Joined: Fri Nov 12, 2004 12:29 am


Return to General discussion

Who is online

Users browsing this forum: No registered users and 2 guests

cron