Closed thesecretmaster closed 5 years ago
Still need a update
method in lib.c, unsure how that'll look.
Whenever this gets done, we'll also want some tests of concurrent operations on the same keys. We'll also want to have about look at the sketchy per-thread safe
global -- that really needs to either be mixed in to main_struct->thread_info
or really, I'm not sure if it serves it's purpose. The intention is to confirm that all threads are in a "safe" place so that deleted elements can be freed by clean_queue
-- to prevent the following sequence:
del
on index 11, then runs clean_queue
(which frees the value at index 11)With safe
, ideally it would be set to false
in 1, so thread B would block until each thread has reached a safe
state at least once, then it would actually clean the queue. This would make thread B block until after A wakes up and completes the operation (and sets safe
back to true)
Currently, predis only supports adding elements and deleting them. Since it currently only stores integers, that's not much of a problem, but as it grows to support more and more types, we'll want to be able to do updates. For example, if we had a
set
type, we'd want to be able to add and remove elements.