4 ms·
I feel your pain. Critical sections are really designed to wrap only a few lines of code. Basically nothing nontrivial should be done within a critical section
by SomeCallMeTim 11y ago
I feel your pain.
Critical sections are really designed to wrap only a few lines of code. Basically nothing nontrivial should be done within a critical section, IMO.
If you're dealing with multithreading, the only safe thing to do with references is to put them in a list of "things to release later." And then do that from the main thread.
GC does make this easier, sure. But creating a "release list" is not hard. Making a GC not stall the program at awkward times is actually a lot harder.