Re: Shared Memory

From: Date: Sat, 14 Oct 2000 20:37:11 +0000
Subject: Re: Shared Memory
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-20167@lists.php.net to get a copy of this message
When you create a shared memory segment the system needs a way to identify your shared memory segment from all other shared memory segments out there. This is accomplished by assigning each shared memory segment an identifier of sorts. The system then uses that identifier as a pointer to your shared memory segment. The key should be a unique number so that the system doesn't confuse your shared memory segment with someone else's memory segment. The access modes for shared memory are the same as for files, ex 644 would mean that the shared memory segment is world readable but only the owner (person who created the memory segment) can write to it. Shared memory is the fastest IPC (Inter Process Communication) method which means its generally used to quickly transfer data between separate process', ex. I use shared memory to transfer date between a C daemon running on a system and a php client. Ilia Alshanetsky iliaa@home.com ----- Original Message ----- From: "Jeff Davis" <jdavis@wasabimg.com> To: <php-general@lists.php.net> Sent: Saturday, October 14, 2000 4:05 PM Subject: [PHP] Shared Memory > I read the following at the php.net manual: > > shm_open() takes 4 parameters: key, which is the system's id for the > shared memory block, this parameter can be passed as a decimal or hex. > > I am interested in using shared memory, but I don't know what to supply > for the key. I also don't know how the access mode (ie 0644) works with > memory. What kinds of situations might shared memory be used for? Is it > to hold data from one script to the next, or should it not be sued for > that? > > Thanks, > Jeff Davis > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net >

« previous php.general (#20167) next »