Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: PHP
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 23:26pm
Edited 29-Apr-13 23:28pm
v2
Comments
Mohibur Rashid at 30-Apr-13 5:06am
   
Why do you want to do that?
Oso Oluwafemi Ebenezer at 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 at 30-Apr-13 5:57am
   
I would suggest you think other way, may be database
Oso Oluwafemi Ebenezer at 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 at 30-Apr-13 6:44am
   
Why not use an in memory database?
Oso Oluwafemi Ebenezer at 30-Apr-13 7:07am
   
Connection overload will still be an issue
Prasad Khandekar at 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
0 George Jonsson 175
1 Kornfeld Eliyahu Peter 169
2 Zoltán Zörgő 139
3 PIEBALDconsult 130
4 OriginalGriff 120
0 OriginalGriff 6,165
1 DamithSL 4,658
2 Maciej Los 4,107
3 Kornfeld Eliyahu Peter 3,649
4 Sergey Alexandrovich Kryukov 3,342


Advertise | Privacy | Mobile
Web02 | 2.8.141220.1 | Last Updated 30 Apr 2013
Copyright © CodeProject, 1999-2014
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