OSDev.org

The Place to Start for Operating System Developers
It is currently Wed Apr 24, 2024 10:44 am

All times are UTC - 6 hours




Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2
Author Message
 Post subject:
PostPosted: Tue Oct 02, 2007 6:32 am 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 11:33 pm
Posts: 3882
Location: Eindhoven
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 12:56 am 
Offline
Member
Member

Joined: Wed Jul 18, 2007 5:51 am
Posts: 170
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.....


Top
 Profile  
 
 Post subject:
PostPosted: Wed Oct 03, 2007 11:55 am 
Offline
Member
Member
User avatar

Joined: Tue Oct 17, 2006 11:33 pm
Posts: 3882
Location: Eindhoven
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... :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 18 posts ]  Go to page Previous  1, 2

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 53 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group