[Top][All Lists]

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

Re: [Chicken-users] Re: An alternative thread system?

From: Ivan Raikov
Subject: Re: [Chicken-users] Re: An alternative thread system?
Date: Tue, 12 Aug 2008 12:13:51 +0900
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

  Guys, I am glad to see that old flame wars never die ;-) Pipes used
to be slow back in the day, around the time when forking and context
switching was slow. Nowadays, modern kernels rely extensively on
zero-copy techniques, and I am pretty sure that Linux has had
zero-copy pipes since at least the 2.4 series. Passing data between
threads may be as simple as an assignment, but it almost never is. In
practice, you always end up having some complicated synchronization
protocol. Why not let the OS handle that for you?


Aleksej Saushev <address@hidden> writes:

> Most overhead originates not from fork, it comes from copying and IPC.
> Passing data between threads may be as simple, as assignment. Note:
> no context switch involved. Passing data between processes is almost
> always two context switches, synchronization in kernel, and copying
> passed data at least twice, unless you use some very system-specific
> hack. Sometimes you can avoid redundant copying by mmaping common file,
> which still brings you to shared-memory and all the stuff connected.
> There's the price of your prejudices in terms of performace lost.
> If you work within properly choosen framework, you may care very little
> about what you are running actually, a thread or a process on another
> machine. Having one subroutine, that merely passes the pointer to locals
> and communicate over network to remote, is easy enough, if you don't
> pass linked structures.

reply via email to

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