guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Does Guile have a thread limit?


From: Mark H Weaver
Subject: Re: Does Guile have a thread limit?
Date: Sun, 06 Apr 2014 02:35:43 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux)

"Diogo F. S. Ramos" <address@hidden> writes:

> The following program is aborted:
>
> (define number-of-thread 1000)
>
> (do ((i number-of-thread (- i 1)))
>     ((zero? i))
>   (call-with-new-thread (lambda () (sleep 42))))

I looked into this, and the issue is that for every thread that's ever
put into Guile mode, Guile creates a pipe which is used to wake it up
while it's sleeping or waiting in 'select', e.g. if an async is queued.

Therefore, two file descriptors are allocated for each such thread.

Unfortunately, if you run out of file descriptors while creating a
thread, it simply aborts, which is obviously suboptimal.  The relevant
code is in threads.c:563.

    Mark



reply via email to

[Prev in Thread] Current Thread [Next in Thread]