2009年1月7日星期三

About the doubt of multi-line Cheng

About the doubt of Monitor:
If say Monitor.Enter method: In appoint his lock is gotten on the object.
And Monitor.Exit method: Release his lock that appoints an object to go up.
And once get (called Monitor.Enter) specify a target (code paragraph) lock, other line Cheng cannot get this lock.

Narrate according to above place, a code paragraph can be carried out only by Cheng of a line, cannot get below the case that next line Cheng did not end to was not released in this line Cheng should be locked up and implement code paragraph, so is the meaning of multi-line Cheng in?
Is the action of multi-line Cheng by many lines Cheng implements this paragraph of code at the same time thereby faster improve efficiency? You are not the doubt to Monitor this, however the doubt of the synchronous problem to whole multi-line Cheng!

没有评论: