Re: Another question about using shmop!

From: Date: Tue, 27 Feb 2001 23:15:17 +0000
Subject: Re: Another question about using shmop!
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-41909@lists.php.net to get a copy of this message
> I read about the php manual, I find that, shmop function can let me use > to store information directly on a shared segment memory. > > However, I have some question about these! > > Does it provide a faster performance, if I use these rather than store > things in mysql DB, I know this might be stupid, but I have to make sure > this. I belive shared memory is *much* faster than MySQL. But there's nothing to "save" your data if the machine crashes, and all sorts of tricky stuff you'll need to figure out on your own about shared memory. Shared memory is not for the faint of heart. > And, can I shared the segment ( the data stored inside ) with different > user session. > Would you show me how. Not only *can* you share it with different user sessions, you have no choice about it. The whole point of shared memory is that *EVERY* process on the machine is using the same memory. So, if you stuff "Hello World" into shared memory location 42, *every* script, every program, every everything on that computer has "Hello World" in shared memory location 42. Period. > Lastly, is there any further information about using this? the manual > only take a little bit!! There's bound to be a HowTo somewhere, but you will really need to be careful. Things you need to think about: What if *two* people run this script at exactly the same time? How do I know my script isn't tromping on other program's usage of shared memory? I can't think of any more, but that's mostly because I consider shared memory "too tricky for me" and have never played with it... -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.general (#41909) next »