[Top][All Lists]

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

Re: [Chicken-users] newbie thread questions?

From: felix winkelmann
Subject: Re: [Chicken-users] newbie thread questions?
Date: Thu, 11 Dec 2008 15:59:10 +0100

On Thu, Dec 11, 2008 at 9:26 AM, Basile STARYNKEVITCH
<address@hidden> wrote:
> (my second mail of questions; I'm very newbie!)

We all are!

> Apparently the Chicken thread package is continuation based and does not use
> pthread hence is not able to take of profit of several cores running several
> pthreads in the same unix process.

That's correct.

> Are there any Chicken packages which are blocking? More specifically, can I
> run, using the http package, both HTTP client & HTTP server & some other
> user code without being blocked by a slow system call?

Blocking system calls will block all running threads. The standard I/O
are multiplexed in the scheduler, but performing operations with POSIX
calls that block (for example when using file-read, etc. from the
posix unit) will
block everything.

> Can I suppose that every chicken thread syncrhonisation primitives (in
> particular mutex) are very cheap? My intuition is that they are user-level
> function without any system calls (ie to futex) inside!

They should be much cheaper than OS-level threads. I once had 500k
threads running on a 512Mb ppc mac (needless to say, slow as
molasses, and without any thread-synchronization or timeouts - just
a mass of threads running idle). I haven't tried this experiment recently,
and it is not in any way representative, of course. The scheduler is
quite simple,
though, and Jörg is stalwartly presenting patches that I will, one
day, try to check out
and integrate (if possible) to improve it.


reply via email to

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