[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: New Feature Request

From: Saint Michael
Subject: Re: New Feature Request
Date: Sun, 27 Dec 2020 13:30:14 -0500

Yes, superglobal is great.
Example, from the manual:
" Shared Memory
Shared memory allows one or more processes to communicate via memory that
appears in all of their virtual address spaces. The pages of the virtual
memory is referenced by page table entries in each of the sharing
processes' page tables. It does not have to be at the same address in all
of the processes' virtual memory. As with all System V IPC objects, access
to shared memory areas is controlled via keys and access rights checking.
Once the memory is being shared, there are no checks on how the processes
are using it. They must rely on other mechanisms, for example System V
semaphores, to synchronize access to the memory."

We could allow only strings or more complex objects, but using bash-language
only, an internal mechanism, and also we need to define a semaphore.

Is it doable?

I am not a low-level developer. My days coding assembler are long gone.

Philip Orleans

Reference: https://tldp.org/LDP/tlk/ipc/ipc.html

On Sun, Dec 27, 2020 at 12:50 PM Eli Schwartz <eschwartz@archlinux.org>

> On 12/27/20 12:38 PM, Saint Michael wrote:
> > Bash is very powerful for its ability to use all kinds of commands and
> pipe
> > information through them. But there is a single thing that is impossible
> to
> > achieve except using files on the hard drive or on /tmp. We need a new
> > declare -g (global) where a variable would have its contents changed by
> > subshells and keep it. I.e. all subshells may change the variable and
> this
> > will not be lost when the subshell exits. Also, a native semaphore
> > technology, so different code being executed in parallel would change the
> > variable in an orderly fashion.
> > I use GNU parallel extensively, basically, my entire business depends on
> > this technology, and now I need to use a database to pass information
> > between functions being executed, back to the main bash script. This is
> > basically ridiculous. At some point we need to turn Bash into more than a
> > shell, a power language. Now I do arbitrary math using embedded Python,
> but
> > the variable-passing restriction is a big roadblock.
> > Philip Orleans
> Essentially, you want IPC. But, you do not want to use the filesystem as
> the communications channel for the IPC.
> So, what do you propose instead, that isn't the filesystem? How do you
> think your proposed declare -g would work? (There is already declare -g,
> maybe you'd prefer declare --superglobal or something?)
> --
> Eli Schwartz
> Arch Linux Bug Wrangler and Trusted User

reply via email to

[Prev in Thread] Current Thread [Next in Thread]