Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TODO: Possible Race Condition in Restore Checkpoint #29

Open
Mrockwell2 opened this issue Aug 2, 2023 · 4 comments
Open

TODO: Possible Race Condition in Restore Checkpoint #29

Mrockwell2 opened this issue Aug 2, 2023 · 4 comments

Comments

@Mrockwell2
Copy link
Contributor

Mrockwell2 commented Aug 2, 2023

void MemoryManager::restore_checkpoint( std::istream& in_s) {
// TODO: We should be holding a lock here

TODO comment turned to issue

@Mrockwell2 Mrockwell2 changed the title Possible Race Condition in Restore Checkpoint TODO: Possible Race Condition in Restore Checkpoint Aug 2, 2023
@jdeans289
Copy link
Owner

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
Copy link
Contributor Author

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
Copy link
Owner

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

@Mrockwell2
Copy link
Contributor Author

Yeah you're probably right

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants