Open powercode007 opened 7 years ago
If there is an upper bound of the number of entries in the array, then you can preallocate the shared array, and create another shared array that counts the number of used items.
Along these lines.
t = sharedmem.empty(upperbound, dtype='f8')
t_used = sharedmem.empty((,), dtype='i8')
t_used[...] = 0
Protected by a lock /critical section you can do
t[t_used] = new_value
t_used[...] += 1
Numpy array have append function. when i create using sharedmem isn't working.
what i want is a while with a condition which append current time in sharedmem numpy arrray. Any direction clue would be helpful. Thanx in advance