Making programs partially threadsafe (Garbage Collector Part 2)
Posted: Mon Dec 19, 2016 10:59 am
As we have in our programs some global arrays for administration of objects and these can be called by the garbage collector I have inserted some code for making thread safe these parts.
The first time I tried with EnterCriticalSection (@slpCriticalSection) and LeaveCriticalSection (@slpCriticalSection) as it would have been done in older C program.
But I got randomly complete program locking without knowing the reason. Then I tried with incapsulation of these array access with the following code and it seems to resolve the issues:
BEGIN LOCK __golockacsutyobj
....
END LOCK
GLOBAL ____golockacsutyobj := OBJECT{} AS OBJECT
Arne
The first time I tried with EnterCriticalSection (@slpCriticalSection) and LeaveCriticalSection (@slpCriticalSection) as it would have been done in older C program.
But I got randomly complete program locking without knowing the reason. Then I tried with incapsulation of these array access with the following code and it seems to resolve the issues:
BEGIN LOCK __golockacsutyobj
....
END LOCK
GLOBAL ____golockacsutyobj := OBJECT{} AS OBJECT
Arne