My application is multi-threaded and has a global map, within which is a list of ids for that key. Each key to the map, and its associated list of ids, will only be written and read by one thread simultaneously, but they can be accessed later by another thread, hence the ‘global’. It’s like this :
Code: Select all
Structure strdata ; Map structure, contains just a list associated with each map key
List List.s()
EndStructure
Global NewMap DataMap.strdata()
Code: Select all
LockMutex(ListMut.i)
AddElement(DataMap(mapkey.s)\List()) ; Add new list element
DataMap()\List() = dataitem.s
UnlockMutex(ListMut.i)

