jdeans289 / icg2

Interface Code Generator 2: Electric Boogaloo
Other
0 stars 2 forks source link

TODO: Possible Race Condition in Restore Checkpoint #29

Open Mrockwell2 opened 1 year ago

Mrockwell2 commented 1 year ago

https://github.com/jdeans289/icg2/blob/aad7ec8e8f7f9bf1c8214a8f56a8bf46add223de/DataTypes/src/MemoryManagement/MemoryManager.cpp#L191-L192

TODO comment turned to issue

jdeans289 commented 1 year ago

Thanks for pulling this up here Marcus! We should consider what we want the synch model for the MemoryManger to be. It's a bit ad-hoc in the current Trick, and I think we need to think about it a little harder. We definitely need some synch, since in Trick the memory manager is often accessed via variable server session or data recording threads, so we should work backwards from that and figure out some requirements.

Also - I want to stop using pthreads directly and use the C++ threading library, which gives us things like RAII style locking.

Mrockwell2 commented 1 year ago

Just read up on RAII and it looks interesting! If we upgrade to C++ threads, would we also need to upgrade the rest of Trick? I'm pretty sure we'll get some pushback on the change if that's the case.

jdeans289 commented 1 year ago

Yeah probably, but it should be contained to Trick internals so hopefully it wouldn't cause issues with our customers.

Mrockwell2 commented 1 year ago

Yeah you're probably right