Looking for critique on custom Queue

Discussion in 'Plugin Development' started by Wolvereness, Jan 29, 2012.

Thread Status:
Not open for further replies.
  1. Offline

    Wolvereness Bukkit Team Member

    Okay, so I just finished writing this queue.
    As far as purpose goes, I want a synchronous thread to take items from this queue. I also want an asynchronous thread to add items to this queue. The purpose in this implementation of what I call a BiThreadedLinkedQueue is so that neither the main thread, nor the feeder thread will block or need to synchronize. If all of the 'add' methods get marked as synchronized, it would easily support an unrestricted number of feeding threads, and never delay the consuming thread.

    So, what do yall think? http://pastebin.com/yg5xT1Qv
     
Thread Status:
Not open for further replies.

Share This Page