simple message passing queue, with option of adding mutex protection and condition variables