-
Notifications
You must be signed in to change notification settings - Fork 15
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
Param thread safety #74
Comments
Can you give some more background on this one? What exact guarantee would (have to ) be provided to achieve "thread-safe parameter access"? In general, we don't talk about multi-threading in SystemC standards as of today. If a tool would want to access the model while the simulation is running, it already has to somehow orchestrate these accesses in case multiple host threads are involved. This is not limited to parameter accesses. Thanks, |
Hi, sorry, don't see this thread before :-) (anyway - I think we should talk about multi-threading, and in that light, building in the protection now - in this corner of the world - is only going to help us in the future :-) ) |
I agree in principle on the goal to have a "thread-safe access guarantee" for parameters, as they are inherently accessed from a tool, which might be running in a separate host process. I'm just wondering how to spell out the rules to achieve that?
To me, this somewhat sounds like a can of worms, especially when it comes to a portable PoC implementation. Can't we just let the tool providers worry about this for now? Or am I misreading the intent of this issue? Thanks, |
We benchmarked adding a spin lock - seems we have an overhead of 8%. Given we have a lock in the param, I think some of your questions become easy. Given SystemC is single threaded, I dont think we need worry about deadlocks (if you are coding up parallel things, then you should be careful, but we can guarantee atomic access to the param). We'll propose a patch, and see what the code looks like, and hoe portable we can make it. |
Parameter access should be thread safe. For example, we need to consider how tools interact with parameters (is it only when the simulation is not running?).
Ballpark effort estimate: 1/2 week.
The text was updated successfully, but these errors were encountered: