From: Vladimir T. <vtz...@gm...> - 2009-06-30 17:00:02
|
On 6/29/09, Sam Steingold <sd...@gn...> wrote: > Vladimir Tzankov wrote: >> On 6/28/09, Don Cohen <don...@is...> wrote: >>> So it seems at least plausible to have > 128 threads. >> >> We can easily increase the limit (as far as we do not get overlap of >> malloc-ed lisp stack and lisp heap). Sam? > > The bug you mentioned (overlap between mmaped and malloc'ed memory) is very > scary. Actually lisp heap overlaps at some time malloc-ed area - since it is expanded via mmap() with MAP_FIXED. On osx large malloc() calls are actually vm_allocate(). I'll check it in details but probably we will get similar issues on other os-es. On i386 linux I can spawn about 550 (sometimes more) before failure - I did not inspect the failure reason but probably it is the same/similar. On win32 mingw - about 350-400. If I decrease the default thread stack(s) - the numbers get higher. These days will test more - but may be we should limit the number of active threads (can be done easily from spvw.d: create_thread()). > More to the point, I abhor arbitrary limits, so I think this one should go > too. > (In fact I wanted to replace the array of threads with a doubly linked > list). done > BTW, I think we should signal an error when create_thread return NULL > instead > of make-thread returning NIL. done |