On Wed, Apr 27, 2022 at 10:37 PM Elijah Stone <[email protected]> wrote:
> On Wed, 27 Apr 2022, Raul Miller wrote:
> > That said, an atomic operation (such as would be provided here) would allow
> > the programmer sufficient control to build other mechanisms.
>
> An atomic operation is not sufficient.  You also need to be able to go to
> sleep.

Well... sure.

But the atomic operation I was specifying included a waiting mechanism.

(Granted, I probably did not specify its behavior fully enough -- I
did not talk about read locks, and I did not address the recursive vs.
non-recursive case. (That's fixable, for example, we could have a
non-recursive case which imposes read locks and a recursive case which
only imposes write locks. But it still indicates a lack of thought.))

That said, for some purposes 6!:3 in a busy loop might be adequate.
(For example, checking roughly ten times a second.)

> > What I think we want, though, is something which minimizes unnecessary
> > verbiage -- stuff like "this operation is really only useful in this phrase"
> > (so why wasn't that phrase introduced as the primitive?).
>
> There is a difficult balance between making the common case easy and making
> the uncommon case possible.  (And avoiding bloat.)

Yes.

And, for something like threading, different people are going to want
conflicting things.

Thanks,

-- 
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to