in reply to Slow shared memory issue
you'll see 'Bad file descriptor'. sysread cannot read from a filehandle opened on a string; it needs a real file descriptor. Also, you probably meant sysread( MEMORY, $data, $size, 0 ) (the third argument is the number of bytes to read and the fourth is offset - thats different from shmread).'memory read' => sub { sysread( MEMORY, $data, 0, $size ) // die $!; }
shmread will probably still be slower, since it reads or writes the System V shared memory segment... by attaching to it, copying in/out, and detaching from it.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Slow shared memory issue
by bash (Scribe) on Mar 27, 2016 at 19:00 UTC | |
|
Re^2: Slow shared memory issue
by bash (Scribe) on Mar 27, 2016 at 18:35 UTC |