Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualCS_

Posted 04 December 2012 - 09:51 PM

Using boost asio with an io service worker thread, I can have the service event loop continually respond to read/write operations as fast as possible and update an internal queue of message packets received from the server. During the main game loop I can simply lock the queue, make a clone, clear, and unlock then process the cloned list.


Double buffer your queue. Add two of them, one for receiving events, one for processing. When the processing queue is, well, processed, throw your lock on the manager and switch the two queues around. Much shorter lock time, I expect.

#1CS_

Posted 04 December 2012 - 09:50 PM

Using boost asio with an io service worker thread, I can have the service event loop continually respond to read/write operations as fast as possible and update an internal queue of message packets received from the server. During the main game loop I can simply lock the queue, make a clone, clear, and unlock then process the cloned list.


Double buffer your queue. Add two of them, one for receiving events, one for processing. When the processing queue is, well, process, throw your lock on the manager and switch the two queues around. Much shorter lock time, I expect.

PARTNERS