[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Library to easily use shared memory to share variables between Apps and Tasks


I have released a version of the ShmMem Shared memory library to the Software farm and also made it available on Github at

 https://github.com/justlostintime/ShmMem and can be cloned from there.

First pass at detailed documentation at https://github.com/justlostintime/ShmMem/wiki.

This library simplifies the usage of shared variables between tasks and apps. This class behaves more like an extension of gambas data types. It is possible to save the state of the image , or individual Symbols. Includes many many examples of usage. Implements most useful shared memory types, queues, priority queues, lists, arrays and simple value. Supporting notifications when variables are created and deleted, and changed. Changing the value in one app will notify all other tasks and apps who are waiting for the value to change. Symbols are dynamically typed, most Gambas types and objects are supported natively. The library is self documenting through the gambas help system as well.

You must install the library to do most testing and run example scripts.

As a simple example,  app 1 does

use ":westwood.shmmem:2.1"

dim mymem as new shmmem("mymemory")

with myMem

     !newvar = 100

end with


app 2 does

use ":westwood.shmmem:2.1"

dim mymem as new shmmem("mymemory")

with myMem

  print !newvar            ' outputs 100

end with

Apps simply share the value of the mymem variable with the task. Which will allow Access to the variables.

The library can be directly installed from https://github.com/justlostintime/ppa from your distributions sub directory.

It me be retrieved using as an example.

    curl -LJO "https://raw.githubusercontent.com/justlostintime/ppa/main/ubuntu/westwood-shmmem_2.1.17-7_all.deb";

Substitute your distribution name.

--
~~~~ Brian

Attachment: OpenPGP_0x78BFB26402F48419.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature