From: MenTaLguY Date: 2006-11-13T16:03:59+09:00 Subject: Re: fast mutexes for 1.8? --=-sNZ1n+lymRJRtemaYWI+ Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On Sun, 2006-11-12 at 09:29 +0900, Joel VanderWerf wrote: > In the ruby-talk thread on "thread death callback" I was suggesting=20 > something a bit different: keep all threads alive in the fork, and raise=20 > an exception (perhaps a subclass of Interrupt) in all threads except the=20 > one that forked, so that they can go thru their ensure clauses and in=20 > particular put the shared data back into a consistent state, clean up=20 > resources, and then give up locks. Threads need to be aware of this=20 > possibility and have ensure clauses to handle the cleanup. Or simply kill them as if they had been killed with Thread.kill. That would ensure that all the ensure clauses were run. I was actually a bit surprised to learn that ensure clauses didn't get called in the fork case -- ensure is darn near invincible otherwise. Of course, there's still the issue of ensure clauses that do things like delete temporary files and the like... -mental --=-sNZ1n+lymRJRtemaYWI+ Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBFWBjXSuZBmZzm14ERAncGAJ42MC34Qr6kTJF2cySkJIPw5PixKwCg26+K NugoHw8TEqKkhQLRrmX13f8= =EevK -----END PGP SIGNATURE----- --=-sNZ1n+lymRJRtemaYWI+--