Ronex Posted August 9, 2013 Report Share Posted August 9, 2013 Can I use blocking system call of kernel, In systemC METHOD process, More specifically suppose I wanted to use mutex lock call on unix system. pthread_mutex_lock is a blocking call, and I am using it for some kind of synchronixation between kernel thread and systemC process(SC_METHOD). What should be a proper approach ? Quote Link to comment Share on other sites More sharing options...
sonalidutta Posted August 20, 2013 Report Share Posted August 20, 2013 You cannot use blocking calls in SC_METHOD process. If you really need to use it, use SC_THREAD process instead. SC_THREAD has all the expressive powers that SC_METHOD has. Quote Link to comment Share on other sites More sharing options...
maehne Posted August 20, 2013 Report Share Posted August 20, 2013 You cannot use blocking calls in SC_METHOD process. If you really need to use it, use SC_THREAD process instead. SC_THREAD has all the expressive powers that SC_METHOD has. This is only partially true. You can use blocking calls in an SC_METHOD, however, then your simulation won't advance. Sometimes, this is exactly what you would like to achieve with a blocking call, e.g., to synchronize your simulation with other operating system processes. sumit_tuwien 1 Quote Link to comment Share on other sites More sharing options...
Ronex Posted August 30, 2013 Author Report Share Posted August 30, 2013 This is only partially true. You can use blocking calls in an SC_METHOD, however, then your simulation won't advance. Sometimes, this is exactly what you would like to achieve with a blocking call, e.g., to synchronize your simulation with other operating system processes. I agree on the stuff that in case of SC_METHOD we can't use any kind of blocking calls of systemC which affects simulation time, But We can use kernel blocking call which at all not related with systemC simulation time and here In my use case I am here uses kernel blocking call to remove systemc process from the execution and allow another kernel thread to execute by the cpu. I wants to confirm whether the approach is right or not ? You cannot use blocking calls in SC_METHOD process. If you really need to use it, use SC_THREAD process instead. SC_THREAD has all the expressive powers that SC_METHOD has. Can you please elaborate why I can't use this ? And share necessary details. Ruffly I would say, "Of Course as it's matter of kernel scheduler which might also remove systemC process(even if systemc execution is inbetween SC_METHOD process ) if time slot for its execution is spend. And here it's similar to that except by using blocking we kind of instruct the kernel that even if time slot is not spend you allow other thread to execute and block me until I met some specific condition." whatever it get understand here. I have Check with a dummy small example which works fine and didn't get any error like normally the one we are getting when we use systemC blocking calls in SC_METHOD. Let me know whether It should be used or not ? Or better to go with SC_THREAD. ( That doesn't makes any sense to me why SC_METHOD shouldn't use ? ) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.