On Tue, Oct 11, 2016 at 9:52 AM, MRAB <python at mrabarnett.plus.com> wrote: >> Also, I don't know when it would ever be safe to release the "memory >> deallocation lock". Just because it's safe for your thread doesn't mean >> it's safe for another thread. And if you do it on a thread-by-thread >> basis, in the above example it might be safe from thread B's perspective >> to release its "memory deallocation lock", but as illustrated that can >> have an effect on thread A. >> > The deallocation lock could be a counter. Doomed objects would be > collectable when it's zero. Yeah, which is why I described it as a "guard". As long as you have atomic increment/decrement (ie if two threads simultaneously try to increment it, it WILL go up by two), it should be fine. Well, that part should, anyway. ChrisA
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4