-
[Answers] Sharedmemory and Systemsemaphore
classes available to enable you to build applications that run as multiple processes and share data/objects in shared memory.
class:
sharedmemory
Description:
Sharedmemory provides access to a shared memory segment by multiple processes. It also provides a way for a process to lock the memory for exclusive access.
Properties:
// this is the unique key that identifies the shared memory you want to attach to
key [RW]
// data is a JSON encoded string. use json_encode() and json_decode() to communicate objects between processes
data [RW]
Methods:
// create() specifies the maximum size of the shared memory segment (default is 64KB)
create( size )
// after setting the key you attach to the shared memory
attach ("readonly" | "readwrite")
// or detach from it
detach()
// you can lock it to gain exclusive access while you read or write the data
lock()
// then unlock the access request
unlock()
class:
systemsemaphore
Description:
A semaphore is a generalization of a mutex. Typically, a semaphore is used to protect a certain number of identical resources.
Properties:
// this is the unique key that identifies the system-wide semaphore
key [RW]
Methods:
// acquire exclusive access
acquire()
// release exclusive access
release()
You can use these new classes in Apps that require multiple Lianja windows and communicate data between the processes. These processes may have a GUI or may be just a service running without a GUI.
All topics in [Answers] alphabetically:http://www.lianja.com/community/show...ll=1#post12352
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
Bookmarks