On Thu, 14 Apr 2022, Raul Miller wrote:

Well... q: u: and x: are counter examples.

u. and x. collide (x. is historical but I think x: predates its removal)

Generally speaking, these are all built on atomic operations. And, if we have an atomic operation, we can build locking on top of it.

That said, it's possible that what you have already implemented is enough here.

There is currently no way to synchronise.

Atomic compare-and-swap (or equivalent) are technically sufficient, but spinloops are slow--especially if implemented in j--unless you are only doing a small amount of work in them; and present j implementations are not very good at doing only a small amount of work. In the case where a problem _demands_ doing a large amount of work, you are also left high and dry. It is necessary to piggyback atop the kernel's scheduling system to implement synchronisation efficiently.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to