Subj : Re: pthread_create and memory To : comp.programming.threads From : Giancarlo Niccolai Date : Thu Mar 17 2005 11:03 am Marcin 'Qrczak' Kowalczyk wrote: Actually, also xharbour generates C code, but that is even 1800 times slower than the equivalent C. I suggest you to do some benchmark on simple math operations, so you have a precise measurement. > Giancarlo Niccolai writes: > > Since I have no idea how to implement a parallel GC, and it's not > clear whether native threads with a GC which stops all threads are > worth the effort (given that it could happen 500 times a second), for > the foreseeable future my language will continue to have the hybrid of > emulated and native threads. Only one thread at a time can access the > runtime. A separate native thread is used for callbacks and for marked > regions of foreign code which don't access the runtime. 500 times? it is quite a lot. Of course it doesn't matter if the GC loop is short, but to minimize your work and make it work also on MT, I suggest you to reduce the GC calls forcing to be no more than X per second and then performing a suspension of currently ready-to-be-suspended threads; when all ready-to-be-suspended threads are suspended, enter the GC. As there will be less GCs in MT mode, your program will require more resource, but architectures where MT can be usefully applied to scripts won't probably be affected very much. Bests, Giancarlo. .