[M3devel] join twice?
Jay K
jay.krell at cornell.edu
Wed Nov 4 07:01:38 CET 2009
> And calling Thread.Fork several times on a single Thread.Closure is
> also idempotent?
Waiting for and getting a result is idempotent, nearly always.
Requesting that work be done may or not be idempotent, depending on the instructions.
"Increase bank balance by $10" vs. "Set bank balance to $10".
- Jay
> To: jay.krell at cornell.edu
> Date: Tue, 3 Nov 2009 07:17:11 -0800
> From: mika at async.async.caltech.edu
> CC: m3devel at elegosoft.com
> Subject: Re: [M3devel] join twice?
>
> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20091104/8fbd78c4/attachment-0002.html>
More information about the M3devel
mailing list