Page 2 of 2

Posted: Tue Oct 02, 2007 6:32 am
by Candy
tom9876543 wrote://reset count of readers
this.numReaders -= 1; //this thread had a read lock
this.numReaders += (2 << 30) //atomic - allow readers to continue
That's a prime example of a very small bug. Compile the code and see how many atoms your atomic code assembles to.

Posted: Wed Oct 03, 2007 12:56 am
by tom9876543
Hello Candy

I did mention earlier that this code is only for working out the logic. I know that you need special assembly code for certain things that why I put the comment "//atomic".

The code will be modified... although I have no idea how to do inline assembly I'll work it out.....

Posted: Wed Oct 03, 2007 11:55 am
by Candy
tom9876543 wrote:Hello Candy

I did mention earlier that this code is only for working out the logic. I know that you need special assembly code for certain things that why I put the comment "//atomic".

The code will be modified... although I have no idea how to do inline assembly I'll work it out.....
As long as you know it's there... :)