New Issue: Create a Chapeltastic way of getting unlocked 'stdin', 'stdout', 'stderr'

24730, "bradcray", "Create a Chapeltastic way of getting unlocked 'stdin', 'stdout', 'stderr'", "2024-03-29T23:36:16Z"

Today, Chapel's stdin, stdout, stderr fileReaders/Writers use locking by default in order to support multiple tasks printing at the same time (as in our hello world examples) in a way that the output will still come out coherent. However, in studying shootouts (and other codes), we find that creating a non-locking version of these channels can result in significant performance improvements, so is sometimes desirable for advanced programmers or performance-sensitive kernels.

Today, the two main ways to create such an unlocking version are:

var consoleOut = stdout.getFile().writer(locking=false);
var consoleOut = (new file(1)).writer(locking=false);

(but note that there can be a big performance difference between these as observed in #24729 ).

both of which are somewhat verbose and roundabout. This issue asks how we should support such channels in a more Chapeltastic way, such as:

  • support a built-in symbol for an unlocked version of each channel, like stdinNoLock, unlockedStdin, stdinNL nonlockingStdin or the like (I'm not crazy about any of these, where the naming challenge is probably the main reason we don't already have these today)
  • support a way of getting a locking or non-locking clone of an existing channel, like stdin.nonLocking() (idea proposed by @benharsh)