Subj : Re: pthread_create and memory To : comp.programming.threads From : Giancarlo Niccolai Date : Wed Mar 16 2005 11:53 am Marcin 'Qrczak' Kowalczyk wrote: > b) Giving each thread a separate young generation, and stopping all > threads in safe places on each GC, is something I would probably be > able to implement, but it would probably not perform well either. > > With the current 128kB default of the global young heap there is an > awfully lot of minor GCs. They are very fast: in the current design > the cost of GC is proportional to live data, and the design of my > language and some properties of its implementation yield much > short-lived data. I have implemented the MT code (including the GC) for the xharbour language (http://www.xharbour.org). The GC is a simple mark-sweep with the MT extension performing a critical section (in the OS2 sense), that is, blocking all the threads in a coherent stated and performing its operations. As xharbour is an I/O heavily based language (is a database dedicated business oriented language) occasions for placing the barriers in correct places are quite common. I have somewhere a paper about true parallel GCS (i.e. the typical three color GC) but the paper compiler provides analysis that demonstrate that a fully mark-sweep GC still performs better in the end (and a generational mark-sweep is nearly an optimum). Just, parallel GCs seems to be useful to prevent process sporadic blocking, which is important in realtime applications, so even if the global GC time is higher in parallel GCs the fact that the process is never really stopped to perform it is important in some context. IMHO this is not generally what untyped VM based languages are meant for; as they are already quite slower than C (depending on the context 300 to 1200 times slower, obviously not counting the time used in C RTL functions, but just the VM loop), I suppose that having faster GC is more important than having a non-blocking one, but this may depend on what the scripting language is aimed to do. Being it possible, it would be also nice to chose the GC type from the application. That's where the reference comes from: http://www.memorymanagement.org/ Bests, Giancarlo. .