[M3devel] join twice?

Mika Nystrom mika at async.async.caltech.edu
Tue Nov 3 16:17:11 CET 2009


Jay K writes:
>
> 	<5788D8FB-8E44-4F62-BF49-9804E173C8A9 at cs.purdue.edu>
> 
>
> <4AEFF851.1E75.00D7.1 at scires.com>
>MIME-Version: 1.0
>
>--_e29f769b-4ae0-4e1d-9ac5-2f25246d5025_
>Content-Type: text/plain; charset="iso-8859-1"
>Content-Transfer-Encoding: quoted-printable
>
>
>To me..with a Win32 background..join means "wait for thread to finish".
>
>And there is a separate action "get thread result".
>
>You could consider these one merged operation "wait for thread to finish an=
>d get its result".
>
>In either case=2C it is reasonable to allow it multiple times.
>
>Waiting for a thread to finish that has already finished is just fast.
>
>Getting a thread result that you already got is also easy albeit usually un=
>necessary.

And calling Thread.Fork several times on a single Thread.Closure is
also idempotent?

It may be "reasonable" to allow such things, but they almost always
signal bugs in the calling code.  Changing the specification to make them
legal is in my opinion losing a valuable opportunity for preventing bugs.
Note the Modula-3 philosophy, not everything reasonable (for a C
programmer's definition of "reasonable", at least) is legal.

     Mika




More information about the M3devel mailing list