From: Eric Hodel Date: 2003-01-22T02:07:06+09:00 Subject: Re: [Threads + Sockets] Strange behavior --CRj9LSjXOCc6Ii+Z Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Peter Hickman (peter@semantico.com) wrote: > I modified your code to include a rescue clause and of course got a=20 > whole load of... >=20 > start > failed > done >=20 > Then I set the socket to a valid address and got a whole load of >=20 > start > done >=20 > So it would seem that your code works but perhaps too fast between the=20 > socket open and close for the other thread to get started. So I added a= =20 > sleep 5 between the open and close. Thread.pass may work as well. =20 > So the problem with your code is that the operation of opening the=20 > socket and closing it is too fast to allow another thread to get started= =20 > giving the appearance of serial execution. >=20 > You are learning fast! --=20 Eric Hodel - drbrain@segment7.net - http://segment7.net All messages signed with fingerprint: FEC2 57F1 D465 EB15 5D6E 7C11 332A 551C 796C 9F04 --CRj9LSjXOCc6Ii+Z Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.0 (FreeBSD) iD8DBQE+LX44MypVHHlsnwQRAlNGAKClixqTGc8lUCtXbGDJQMYTBxzz2QCfVjDX L7ZP+dzgBIROiGbYiyn12gw= =ygp0 -----END PGP SIGNATURE----- --CRj9LSjXOCc6Ii+Z--