Critical Region

Critical region是指access shared data的code, 注意不是shared code itself,所以用C做multithread的时候,这样的code因为多个thread在使用而且thread之间共享memeory,所以这样的code要用mutex lock起来保证其每次只被一个thread使用,从而避免race condition

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s