From: Eric Hodel Date: 2002-12-14T08:35:56+09:00 Subject: Re: Ruby slow?? --5G06lTa6Jq83wMTw Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Matt Armstrong (matt@lickey.com) wrote: > "Garriss, Michael" writes: > > > > http://www.bagley.org/~doug/shootout/bench/prodcons/ >=20 > That test creates 100,000 ruby threads and uses lots of thread > primitives. Threads are pretty slow in Ruby because of the way they > are implemented (each thread switch involves a large memcpy() of the > stack). No, the test creates two threads. It passes 100,000 integers from the producer thread to the consumer thread via a shared variable 'data', locking and unlocking a Mutex 200,000 times. --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --5G06lTa6Jq83wMTw Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE9+m7aMypVHHlsnwQRAvxxAJwK4Le6nmFv/Y8vs+EIyN0rZNSGbgCZASuo Y0Q04Zfc+rJcOM+pGCRi9VQ= =jUhH -----END PGP SIGNATURE----- --5G06lTa6Jq83wMTw--