Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  newsreader  groups  login

Message-ID:  

Don't hit the keys so hard, it hurts.


computers / comp.os.vms / Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical name settings for UNIX compat.)

SubjectAuthor
* Best DECC$ logical name settings for UNIX compat.Jake Hamby (Solid State Jake)
`* Re: Best DECC$ logical name settings for UNIX compat.John Reagan
 `* Re: Best DECC$ logical name settings for UNIX compat.Jake Hamby (Solid State Jake)
  `* Re: Best DECC$ logical name settings for UNIX compat.Craig A. Berry
   +* Re: Best DECC$ logical name settings for UNIX compat.John Reagan
   |`* Re: Best DECC$ logical name settings for UNIX compat.John Reagan
   | `* Re: Best DECC$ logical name settings for UNIX compat.Simon Clubley
   |  `- Re: Best DECC$ logical name settings for UNIX compat.bill
   +* Re: Best DECC$ logical name settings for UNIX compat.Arne Vajhøj
   |+* Re: Best DECC$ logical name settings for UNIX compat.Simon Clubley
   ||`* Re: Best DECC$ logical name settings for UNIX compat.Arne Vajhøj
   || +* Re: Best DECC$ logical name settings for UNIX compat.Jake Hamby (Solid State Jake)
   || |`- Re: Best DECC$ logical name settings for UNIX compat.Craig A. Berry
   || +* Re: Best DECC$ logical name settings for UNIX compat.Dave Froble
   || |`* Re: Best DECC$ logical name settings for UNIX compat.Arne Vajhøj
   || | `* Re: Best DECC$ logical name settings for UNIX compat.Dave Froble
   || |  `* Re: Best DECC$ logical name settings for UNIX compat.Arne Vajhøj
   || |   `* Re: Best DECC$ logical name settings for UNIX compat.Dave Froble
   || |    +* Re: Best DECC$ logical name settings for UNIX compat.Jan-Erik Söderholm
   || |    |`- Re: Best DECC$ logical name settings for UNIX compat.Dave Froble
   || |    `- Re: Best DECC$ logical name settings for UNIX compat.Arne Vajhøj
   || +* Re: Best DECC$ logical name settings for UNIX compat.hb@end.of.inter.net
   || |`* Re: Best DECC$ logical name settings for UNIX compat.Arne Vajhøj
   || | `* Re: Best DECC$ logical name settings for UNIX compat.hb@end.of.inter.net
   || |  `* Re: Best DECC$ logical name settings for UNIX compat.Arne Vajhøj
   || |   `* Re: Best DECC$ logical name settings for UNIX compat.hb@end.of.inter.net
   || |    +- Re: Best DECC$ logical name settings for UNIX compat.hb@end.of.inter.net
   || |    `* Re: Best DECC$ logical name settings for UNIX compat.Arne Vajhøj
   || |     +- Re: Best DECC$ logical name settings for UNIX compat.Stephen Hoffman
   || |     `* Re: Best DECC$ logical name settings for UNIX compat.Jake Hamby (Solid State Jake)
   || |      +- Re: Best DECC$ logical name settings for UNIX compat.Arne Vajhøj
   || |      +* pipes and Perl and sys$sigprc (Re: Best DECC$ logical name settingsCraig A. Berry
   || |      |`* Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameJake Hamby (Solid State Jake)
   || |      | `* Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameVitaly Pustovetov
   || |      |  `* Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameJake Hamby (Solid State Jake)
   || |      |   +* Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameDavid Jones
   || |      |   |`* Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameCraig A. Berry
   || |      |   | `- Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameVitaly Pustovetov
   || |      |   `* Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameCraig A. Berry
   || |      |    `* Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameJake Hamby (Solid State Jake)
   || |      |     `* Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameCraig A. Berry
   || |      |      `* Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameJake Hamby (Solid State Jake)
   || |      |       +* Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameCraig A. Berry
   || |      |       |`- Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameJake Hamby (Solid State Jake)
   || |      |       `* Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameMark Berryman
   || |      |        +- Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameJake Hamby (Solid State Jake)
   || |      |        `- Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical nameCraig A. Berry
   || |      `- Re: Best DECC$ logical name settings for UNIX compat.Stephen Hoffman
   || `* Re: Best DECC$ logical name settings for UNIX compat.David Jones
   ||  `- Re: Best DECC$ logical name settings for UNIX compat.John Reagan
   |`- Re: Best DECC$ logical name settings for UNIX compat.Stephen Hoffman
   `- Re: Best DECC$ logical name settings for UNIX compat.Craig A. Berry

Pages:123
Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical name settings for UNIX compat.)

<70d16c9b-9533-4ac5-a384-7b536a5f8a11n@googlegroups.com>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30886&group=comp.os.vms#30886

  copy link   Newsgroups: comp.os.vms
X-Received: by 2002:a05:6214:162d:b0:66d:323:ffbe with SMTP id e13-20020a056214162d00b0066d0323ffbemr210055qvw.11.1698712699449;
Mon, 30 Oct 2023 17:38:19 -0700 (PDT)
X-Received: by 2002:a05:6870:618f:b0:1ea:973:51da with SMTP id
a15-20020a056870618f00b001ea097351damr5511546oah.0.1698712699219; Mon, 30 Oct
2023 17:38:19 -0700 (PDT)
Path: i2pn2.org!i2pn.org!paganini.bofh.team!2.eu.feeder.erje.net!feeder.erje.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!news-out.google.com!nntp.google.com!postnews.google.com!google-groups.googlegroups.com!not-for-mail
Newsgroups: comp.os.vms
Date: Mon, 30 Oct 2023 17:38:18 -0700 (PDT)
In-Reply-To: <uhopsn$idsm$1@dont-email.me>
Injection-Info: google-groups.googlegroups.com; posting-host=2600:1700:46b0:abc0:8d8a:77af:b1b0:111b;
posting-account=OGFVHQoAAAASiNAamRQec8BtkuXxYFnQ
NNTP-Posting-Host: 2600:1700:46b0:abc0:8d8a:77af:b1b0:111b
References: <bdbae9cb-8cdb-4b78-a5b7-4bce444ae23en@googlegroups.com>
<805c5652-d5b5-4a20-a6ea-0b6961aa1878n@googlegroups.com> <ugoghm$3kn0t$1@dont-email.me>
<ugonni$3m8cp$1@dont-email.me> <ugp6dg$3pafl$2@dont-email.me>
<ugp8fd$3q2t8$1@dont-email.me> <76de2d16-f9f0-47cf-97af-99a81757692bn@googlegroups.com>
<ugsd0q$k66b$2@dont-email.me> <2246f848-0006-4ecb-af5e-e95feb6d12b7n@googlegroups.com>
<ugtv2r$13ime$2@dont-email.me> <6498715c-4daf-4387-b651-72c9d86c49d5n@googlegroups.com>
<uh5uhk$35lu7$2@dont-email.me> <ad0ede23-4206-47c0-84eb-4fd2ede5e749n@googlegroups.com>
<uh77i3$3g2rq$1@dont-email.me> <b7b98453-c696-4b72-9560-eee1f082e816n@googlegroups.com>
<8498aa38-9c16-4d33-b25a-c1a53e96846an@googlegroups.com> <f99038c9-5242-4556-a098-af4af1c3fec5n@googlegroups.com>
<uhcdm5$14o2h$1@dont-email.me> <206fa30f-ce83-42f1-aa69-b8c825b82308n@googlegroups.com>
<uhejhd$1rmnf$1@dont-email.me> <d389f3b2-3b67-4e31-98cc-6e1de9f4a907n@googlegroups.com>
<uhopsn$idsm$1@dont-email.me>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <70d16c9b-9533-4ac5-a384-7b536a5f8a11n@googlegroups.com>
Subject: Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical name
settings for UNIX compat.)
From: jake.ha...@gmail.com (Jake Hamby (Solid State Jake))
Injection-Date: Tue, 31 Oct 2023 00:38:19 +0000
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
 by: Jake Hamby (Solid St - Tue, 31 Oct 2023 00:38 UTC

On Monday, October 30, 2023 at 10:41:47 AM UTC-7, Mark Berryman wrote:
> In all cases where I have needed to "fork" a process with I/O passing
> back and forth between the two processes, I have found that using
> socketpair instead of pipes works much better. Socketpair is designed
> for streams and completely eliminates the issue of pipes trying to be
> record-oriented.
>
> FYI in case you'd care to try it.
>
> Mark Berryman

I did some testing with an IPC benchmark some time ago and socketpair() was better than pipe() in all cases if DECC$STREAM_PIPE isn't defined, and with larger write sizes when it is.

Thanks for the suggestion. I just finished running the Perl test harness with DECC$STREAM_PIPE enabled, DECC$STREAM_BUFFER_SIZE set to 8192, and DECC$STREAM_BUFFER_QUOTA set to 65536, and it was noticeably faster than with the defaults, and it didn't leave any child processes hanging in RWMBX.

But perhaps socketpair() is even faster. The most recent test runs I have took 4758 wallclock secs with default pipe sizes and 4075 wallclock secs with the larger pipe sizes.

Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical name settings for UNIX compat.)

<uhplrp$n8u5$1@dont-email.me>

  copy mid

https://www.novabbs.com/computers/article-flat.php?id=30887&group=comp.os.vms#30887

  copy link   Newsgroups: comp.os.vms
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder2.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail
From: craigbe...@nospam.mac.com (Craig A. Berry)
Newsgroups: comp.os.vms
Subject: Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical name
settings for UNIX compat.)
Date: Mon, 30 Oct 2023 20:39:04 -0500
Organization: A noiseless patient Spider
Lines: 104
Message-ID: <uhplrp$n8u5$1@dont-email.me>
References: <bdbae9cb-8cdb-4b78-a5b7-4bce444ae23en@googlegroups.com>
<805c5652-d5b5-4a20-a6ea-0b6961aa1878n@googlegroups.com>
<ugoghm$3kn0t$1@dont-email.me> <ugonni$3m8cp$1@dont-email.me>
<ugp6dg$3pafl$2@dont-email.me> <ugp8fd$3q2t8$1@dont-email.me>
<76de2d16-f9f0-47cf-97af-99a81757692bn@googlegroups.com>
<ugsd0q$k66b$2@dont-email.me>
<2246f848-0006-4ecb-af5e-e95feb6d12b7n@googlegroups.com>
<ugtv2r$13ime$2@dont-email.me>
<6498715c-4daf-4387-b651-72c9d86c49d5n@googlegroups.com>
<uh5uhk$35lu7$2@dont-email.me>
<ad0ede23-4206-47c0-84eb-4fd2ede5e749n@googlegroups.com>
<uh77i3$3g2rq$1@dont-email.me>
<b7b98453-c696-4b72-9560-eee1f082e816n@googlegroups.com>
<8498aa38-9c16-4d33-b25a-c1a53e96846an@googlegroups.com>
<f99038c9-5242-4556-a098-af4af1c3fec5n@googlegroups.com>
<uhcdm5$14o2h$1@dont-email.me>
<206fa30f-ce83-42f1-aa69-b8c825b82308n@googlegroups.com>
<uhejhd$1rmnf$1@dont-email.me>
<d389f3b2-3b67-4e31-98cc-6e1de9f4a907n@googlegroups.com>
<uhopsn$idsm$1@dont-email.me>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
Injection-Date: Tue, 31 Oct 2023 01:39:05 -0000 (UTC)
Injection-Info: dont-email.me; posting-host="0550d8f94362420221b53e64bb93c769";
logging-data="762821"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18LqPMvtW2h0uoR77i4mDG5PebtPvpA99o="
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:29giEhd5/0LSOCwpmePKvlSJwVE=
Content-Language: en-US
In-Reply-To: <uhopsn$idsm$1@dont-email.me>
 by: Craig A. Berry - Tue, 31 Oct 2023 01:39 UTC

On 10/30/23 12:41 PM, Mark Berryman wrote:
> On 10/26/23 9:10 PM, Jake Hamby (Solid State Jake) wrote:
>> On Thursday, October 26, 2023 at 1:52:03 PM UTC-7, Craig A. Berry wrote:
>>>>
>>> I don't think I know the answers to all your questions, but here are a
>>> few things to consider, in no particular order.
>>>
>>> Look for isdcl in setup_cmddsc(). There is already code that attempts to
>>> detect whether the command being spawned is DCL or is a program that can
>>> be run with MCR. Someone recommended a while back that we use exec() and
>>> decc$set_child_standard_streams for the latter cases and only use
>>> lib$spawn for the former. It's a reasonable suggestion that never got
>>> implemented.
>>>
>>> I'm not sure it's reasonable to abandon the lib$spawn entirely because
>>> Perl definitely needs the ability to run DCL commands in subprocesses.
>>> posix_spawn() is supposedly getting added to the CRTL but I don't know
>>> the status of that or whether it could handle both the exec and spawn
>>> cases. It might be possible to create all subprocesses via sys$creprc,
>>> specifying SYS$SYSTEM:LOGINOUT.EXE when you want DCL and the actual
>>> image if you want more exec-like behavior.
>>>
>>> Perl's home-grown waitpid() first looks for processes created by the
>>> home-grown popen(). If it doesn't find one it falls back to the CRTL,
>>> and if it still doesn't find one, it calls $getjpi once a second until
>>> it gets SS$_NONEXPR. So I'm skeptical of the claim that it always
>>> returns -1 if the process is not created by popen() or exec(). Possibly
>>> you don't have privileges to check the status of the target process?
>>>
>>> I've tried pretty hard to get rid of vmspipe.com and never found a way
>>> to do so. There is already fallback code that will create one on the
>>> fly if it's not found for some reason, so going the temp file route
>>> would basically just involve not installing the pre-built vmspipe.com.
>>
>> After much trial and error, and figuring out how to wrap all the code
>> blocks in order for the parent vfork() code path to free all of the
>> memory properly (I've found that the vfork() and execv() really need
>> to be in the same function and stack frame), I have a working
>> prototype, and it even seems to be faster than the vmspipe version.
>>
>> Sadly, you're right about DCL commands and having to use lib$spawn to
>> execute them. My build fails as soon as it gets to ext/errno/errno_pm
>> .pl which tries to run " LIBRARY/EXTRACT=ERRNO/OUTPUT=SYS\$OUTPUT
>> $file |" (with the leading space). Before that, I had to patch
>> make_ext .pl to not add quotes around the arguments, because they
>> weren't getting stripped off, and then, after looking up foreign
>> commands as symbols, peeling off any leading "@" or "$", and skipping
>> any leading "mcr", at least I have system() working reliably and not
>> leaving any orphaned subprocesses behind like some of my earlier
>> experiments did.
>>
>> The worst of all possible worlds would appear to be UNIX pipes with
>> vfork()/exec() to run vmspipe. It works, but slowly, and not very well.
>>
>> I think the best approach from here will be to use the isdcl() logic
>> you mentioned to decide which way to go after creating the pipe()
>> pair, and then I can keep around a very stripped-down version of the
>> Pipe struct that just has the pid and completion status, and reuse the
>> pclose()/waitpid() logic for that case, and use POSIX calls otherwise.
>> The relevant files I'm looking at are:
>>
>> - pp_sys.c - wrapper for system()
>> - util.c - wrappers for popen()/pclose()
>> - doio.c - wrappers do_aexec5() and do_exec3()
>>
>> I'll make sure to clean up my diffs as best I can before checking them
>> into my experimental branch. The one really ugly hack that I'd like to
>> clean up was that in order to combine the fork() and exec() in my
>> versions of do_aexec5() and do_exec3(), I had to change their function
>> signatures to return Pid_t instead of bool, so the parent (with
>> #ifdef'd changes for VMS) code path can execute with the pid that
>> would have been returned by fork(). So that required a patch to
>> embed.fnc and then regenerating proto.h.
>>
>> To avoid the ugliness of changing a function signature for everyone,
>> I'll probably add new vms_do_aexec5() and vms_do_exec3() prototypes in
>> vms/vmsish.h with the Pid_t return type. The code can still be shared
>> in doio.c, but with a different function name for the VMS version.
>
> In all cases where I have needed to "fork" a process with I/O passing
> back and forth between the two processes, I have found that using
> socketpair instead of pipes works much better.  Socketpair is designed
> for streams and completely eliminates the issue of pipes trying to be
> record-oriented.
>
> FYI in case you'd care to try it.
>
> Mark Berryman
>

I once implemented Perl's pipes using socketpair as an experiment,
hoping to replace the mailbox-based pipes we have now. It certainly
provided stream behavior, so much so that it swallowed and discarded all
carriage returns and newline characters, even when they were genuinely
present in the stream. I could avoid that by enabling carriage control
processing on the socket, which then introduced record boundaries on
every write just like mailboxes do. But it was worse because the buffer
size defaults to 255 bytes on a socket and can't be changed without
privileges.

So that experiment failed. Possibly it was operator error and there was
some combination of knobs and buttons I didn't get set right. But that
was my experience.


computers / comp.os.vms / Re: pipes and Perl and sys$sigprc (Re: Best DECC$ logical name settings for UNIX compat.)

Pages:123
server_pubkey.txt

rocksolid light 0.9.81
clearnet tor