Showing results for 
Search instead for 
Did you mean: 

Reducing time with CDB locked

I'm writing a package that requires a potentially lentghy elaboration and I don’t want block all the other operations on CDB.

I isolated the portion that requires most of the time but I still need to have some form of “locking”. It wold be great if I could “lock” not the entire CDB but only a portion of it: in my case a simple (though huge) list. Is it possible? How can I do?

Atlernatively I could block only the threads stemmed by my package (the list is used only by that) using some form of semaphore such as the threading.lock primitive in Python. Is it possible? How can I do?


More details

The package is written in Python. It reads a list of “bookings” in order to assess if a new request can be accomplished. The list is expected to be very large: in my simulations it may take several seconds of elaboration. During this elaboration no modification are allowed on the list. At the end of the procedure the list is updated and devices will eventually be configured.

I read that there is the possibility to run code without locking the CDB in the function preLockCreate but I’ve been a bit puzzled by the statemet I found in the developer guide:

The preLockCreate FASTMAP algorithm has internal detection of conflicting concurrent transaction data

updates. This implies that the there is no risk of persistent data inconsistencies but instead a conflicting transaction might fail in commit

So I don’t know if it fits my need or not.