chicken-users
[Top][All Lists]
Advanced

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

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


From: Alaric Snell-Pym
Subject: Re: [Chicken-users] Re: An alternative thread system?
Date: Wed, 13 Aug 2008 18:00:37 +0100

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


On 13 Aug 2008, at 7:29 am, Aleksej Saushev wrote:

Ivan Raikov <address@hidden> writes:

  Guys, I am glad to see that old flame wars never die ;-)

Yes, but I have no time to participate in them today, hence I quit.

Pipes used to be slow back in the day, around the time when
forking and context switching was slow.

Context switch remains to be slow.

Ah, but how many context switches do you need? Look carefully at what
Elf's arguing for: *chicken* threads combined with OS-level processes
to get parallelism when you want to use more cores. There's no
context switch between chicken threads, and they remain safe because
chicken controls its own scheduling, so can cheaply and safely ensure
correctness around the heap and other core data structures, such as
inter-thread zero copy just-pass-a-pointer message queues.

And if you have one OS-level process per core joined by pipes (easily
scaled to be multiple processes on different physical machines
connected by TCP sockets, too, as your needs grow), then you'll only
be getting context switches to handle actual other jobs.

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.

Pipes are zero-copy inside, yet you end serializing your data
structures
(either directly or via some protocol) just to write them, and you
have
to parse what you serialized.

There are very fast techniques available for this...

ABS

- --
Alaric Snell-Pym
Work: http://www.snell-systems.co.uk/
Play: http://www.snell-pym.org.uk/alaric/
Blog: http://www.snell-pym.org.uk/?author=4


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.8 (Darwin)

iEYEARECAAYFAkijEzYACgkQRgz/WHNxCGrlkwCcDDLIoEU5NKlUzRIRNbcxMkT2
ziYAnA2RtoAhxAkHXcMQ+lYmqARgNwY3
=CPYD
-----END PGP SIGNATURE-----




reply via email to

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