[comp.lang.perl] Why...

rbj@uunet.UU.NET (Root Boy Jim) (03/08/91)

...do shmread & shmwrite exist? Was it too much trouble to
	create a variable whose size and location were fixed?

...given that we really do want shmread & shmwrite, why is the
	shared memory region repeatedly attached to & from?
	Does perl open & close files between I/O :-)

...is the length required on read, sysread, and syswrite?
	Use the length of the scalar by default.

...is the bits expression in vec required to be a power of two?

...can't waitpid be built from wait3? It is powerful enuf.

...is the sky blue? [I wanted to give you an easy one :-]
-- 
		[rbj@uunet 1] stty sane
		unknown mode: sane

chip@tct.uucp (Chip Salzenberg) (03/09/91)

According to rbj@uunet.UU.NET (Root Boy Jim):
>...do shmread & shmwrite exist? Was it too much trouble to
>	create a variable whose size and location were fixed?
>
>...given that we really do want shmread & shmwrite, why is the
>	shared memory region repeatedly attached to & from?
>	Does perl open & close files between I/O :-)

I did the System V IPC support, so let me answer.

The reason was... laziness and impatience!  (How appropriate for
hacking Perl features...)

I needed support for System V IPC, but I didn't need speed.  I didn't
(and still don't) understand Perl's internals well enough to hack in
fixed-location and fixed-size variables.  Ergo, shmread/shmwrite.

As for the attach/detach, that's necessary to allow removed shared
memory segments to disappear -- if you keep a segment attached, it
will never disappear.
-- 
Chip Salzenberg at Teltronics/TCT     <chip@tct.uucp>, <uunet!pdn!tct!chip>
 "Most of my code is written by myself.  That is why so little gets done."
                 -- Herman "HLLs will never fly" Rubin