Daniel Turing a écrit :
Hi,

i'm having problems with neko threading. The following program:
[...]
counts to 380 or 381 on my 32bit machine, then:
Test.hx:23: 381: true
Called from <null> line 1
Called from Test.hx line 21
Called from neko/vm/Thread.hx line 57
Uncaught exception - s...@thread_create


on my 64bit, it's even worse, counting to an unpredictable number and
crashing with:
An exception occured in a neko Thread :
C Stack overflow

(additionally, i cant get me to trust Lock and Mutex on the 64bit, but
no formal tests there (yet))

in vm/threads.c, neko_thread_create, the "tparams p" is allocated on the
stack-- might that be the source of these problems?

I think that's normal.

In your example, you are not sure that the other thread is terminated when you get back control from your main thread. Due to scheduling issues, it might be possible that unterminated threads accumulates and that the OS runs out of memory.

Try reusing threads as much as possible, since anyway thread creation is expensive.

Best,
Nicolas

--
Neko : One VM to run them all
(http://nekovm.org)

Reply via email to