Click here to Skip to main content
13,089,818 members (47,687 online)
Rate this:
Please Sign up or sign in to vote.
See more:
Please how can shared memory be created in PHP using shmop_* (not shm_* if that matters) be locked and unlocked? Does this require libraries?

It seems shmop_read() runs while shmop_write() is still writing because the value read has part of old and new values.

This is the situation, there are three sections. Section One open/create the shared memory segment and write/update it content. Section Two update what is already written into the segment while the Section Three read what is in the segment. Any of these sections can run at any time.
Posted 29-Apr-13 22:26pm
Updated 29-Apr-13 22:28pm
Mohibur Rashid 30-Apr-13 5:06am
Why do you want to do that?
Oso Oluwafemi Ebenezer 30-Apr-13 5:22am
Because am using the shared memory to monitor some user interactions and while reading content out of the segment, any user may perform any action that necessitate writing to the segment which will result in the situation I describe above.
Mohibur Rashid 30-Apr-13 5:57am
I would suggest you think other way, may be database
Oso Oluwafemi Ebenezer 30-Apr-13 6:07am
Database is out of the question because of heavy connection which database can't handle. Say 30k users at the same time!
Prasad Khandekar 30-Apr-13 6:44am
Why not use an in memory database?
Oso Oluwafemi Ebenezer 30-Apr-13 7:07am
Connection overload will still be an issue
Prasad Khandekar 30-Apr-13 8:22am
Please have a look at memcached. It might be useful for you.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 30 Apr 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100