Jump to content
Sign in to follow this  

Context switching in the SystemC scheduler

Recommended Posts

Hello All,

I was wondering to understand Context switching in the SystemC scheduler.


What I found is that It is something which makes the threads slower than methods.


Can anyone please explain it.




Share this post

Link to post
Share on other sites

SC_THREADs allow the user to call wait() to suspend the process. When the process executes the wait() function, it has to store its state somewhere (the state consists of the value of local thread variables and the programme counter indicating where the computer should resume executing after the call to wait()).


The process of storing the state so that another process can run is called a context switch, which does indeed take time.


So SC_THREADs are slower than SC_METHODs - but then SC_METHODs can't suspend,




Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this