Nim is a compiled, garbage-collected systems programming language with a design that focuses on efficiency, expressiveness, and elegance (in that order of priority).
The POSIX shm_open() function returns a file descriptor that can be used to access shared memory. This is extremely convenient because one can use all the traditional mechanisms for controlling file descriptors to also control shared memory.
note
for temporary scope / auto-cleanup there are a few options:
Context provides a means of transmitting deadlines, caller cancellations, and other request-scoped values across API boundaries and between processes. It is often used when a library interacts — directly or transitively — with remote servers, such as databases, APIs, and the like.
links
example use cases
note
for temporary scope / auto-cleanup there are a few options:
deferScoped
, library defined scopeddefer
by timotheecour · Pull Request #16048 · nim-lang/NimO_EXCL
std/tempfiles
scratch below
O_TMPFILE
Issue 21515: Use Linux O_TMPFILE flag in tempfile.TemporaryFile? - Python tracker
https://man7.org/linux/man-pages/man2/openat.2.html has good explanation for
O_TMPFILE
O_BENEATH
open() flags: O_TMPFILE and O_BENEATH [LWN.net]
open2
openat2(2) - Linux manual page