Talz Posted March 15 Report Share Posted March 15 Hi, this is a general question about data synchronization in systemc between threads. lets say i have a module with a global variable (e.g int) and two SC_THREAD that both read and write from it. does systemc ensures somehow that the memory updates of one of the thread is visible to another? usually i would use volatile/fence/atomic that insures the compiler reads the value from memory and not from register but i did not find any instances of this in systemc code or in systemc examples. can i assume a more standard way to solve this is to use sc_signal<int> and do read()/write() operations on it? what happens if i want to use a large struct and i want to update only a small part of it? it seems a bit expensive to read/write the entire struct each time. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.