|
[
Permalink
| « Hide
]
agilewang added a comment - 12/May/07 04:26 PM
I'm sorry,the test file is not
I applied changes to the class according to your ideas... only a little different... anyway, it would be nice if you could test that. Just downloading the class compiling and exchanging it with the version form the beta should do the job. Or you do a full build of course
Great,I have downloaded the new source from SVN,and rerun the test case which passed well.
But I have a problem about the method : private void unlockWrite(){ Why do you use the writeLock.notify() rather than the writeLock.notifyAll()? Though the test is passed,I have a little worry about notiy() . ups, you are right... small mistake. First I thought that would result in multiple concurrent writes, but as wait needs to reacquire the monitor first that will not happen.
But I noticed the implementation does still have a whole... If I have two read threads, where the first (T1) is running in unlockWrite, the second (T2) waiting in lockWrite and the write thread (T3) waiting in waitForWriteState. If now T3 starts before T2 all is ok, if T2 starts before T3 I have a concurrent write and read... which means I need to add the loop again, because if T2 starts first concurrentRead is!=0 and the write waits for the next time... ok so two false cahnges, fixed in a few minutes I'll update to your newest implements.
Other problem is serious too, please see here http://jira.codehaus.org/browse/GROOVY-1882 I don't know if you have viewed it,I wish you should take some time to check the report. Thank you |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||