RE: [PHP] Shared Memory in PHP

From: Date: Thu, 24 Aug 2000 15:13:07 +0000
Subject: RE: [PHP] Shared Memory in PHP
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-13440@lists.php.net to get a copy of this message
There is no way of doing that without rewriting at least part of PHP's shared memory functions, or digging into the PHP code to see how the data is represented. PHP's shared memory blocks have a php signature in them, so in effect PHP, OOTB, cannot read data from any given shared memory block. The easiest path to do what you want is to is examine the shared memory blocks that PHP generates, and create 'php-compatible' shared memory blocks in C. And semaphores in PHP are dangerous things. Thread lightly when using them. And make quadruple-sure that a semaphore will NEVER, EVER encounter a locked state for an extended period. The PHP script timeout functions will not work when you are in a locked state, so this can potentially drain your pool of httpd processes. Communication between PHP and a C program is probably easier with sockets. See the 'network' section in the PHP manual. (and unix domain sockets are pretty fast too) -S > -----Original Message----- > From: Kevin Beckford [mailto:kbeckford@bigorbit.com] > Sent: 24 August 2000 17:07 > To: Raju Sivasankaran; GPHP > Subject: Re: [PHP] Shared Memory in PHP > > > check out the semaphore functions in php > ----- Original Message ----- > From: Raju Sivasankaran <raju_m_s@yahoo.com> > To: <php-general@lists.php.net> > Sent: Thursday, August 24, 2000 10:54 AM > Subject: [PHP] Shared Memory in PHP > > > > Hi, > > > > I want to communicate between a php program and a > > C program. A shared memory segment can be created > > in the C program and then I can use php's shm_attach > > to attach to the segment. How do i start reading > > (writing) stuff of (to) the shared memory segment in > > php. > > > > Thank You. > > > > - raju > > > > > > __________________________________________________ > > Do You Yahoo!? > > Yahoo! Mail - Free email you can access from anywhere! > > http://mail.yahoo.com/ > > > > -- > > 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 > > > > > -- > 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 (#13440) next »