🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Stage 1 Completed... Get Ready!

Published March 16, 2009
Advertisement
After significant amounts of scouring across the intertron, and after pulling out large clumps of hair, I've managed to get lock-free message passing implemented in Epoch. This is cool because it makes it trivial to throw hundreds of messages around between tasks, and it's much more efficient than locking all the time.

Unfortunately, I have two problems:
  • The implementation is prone to the ABA problem. I have a minor suspicion that this won't actually bite me because of the way messages are tracked, but I'm way too brain-dead to prove it.

  • The implementation is of a LIFO stack. This means that the order of messages is not preserved; i.e. if I send a task the messages A,B,C,D, it may get them in any unpredictable order. I'd really prefer the semantics to be FIFO, so that if I send A,B,C,D then that's exactly the order the target thread reads the messages.


So I'm going to work on shifting towards a FIFO queue; I've got my eye on an implementation that promises to also solve the ABA problem, so that should be good.

All in all, this was actually less of a problem than I expected; I think I'll be done well before the Wednesday deadline. This is good, because the code needs a lot of polish before I'm really comfortable with releasing it at GDC.


Don't touch that remote - we'll be back shortly with yet more Gooey Chewy Epoch Goodness.
Previous Entry Locklessness is evil!
Next Entry Celebration time...
0 likes 0 comments

Comments

Nobody has left a comment. You can be the first!
You must log in to join the conversation.
Don't have a GameDev.net account? Sign up!
Profile
Author
Advertisement
Advertisement