Message queues


  • Java Dev

    So, we've got this high-performance data processing process, implemented in C. Recently, a collegue (my boss, because my boss +1 wanted to save time on doing yearly appraisals) rewrote part of the threading model for a vague reason related to future functionality.

    While I was on vacation, and he was about to, he got pressured into merging the thing into MAIN. Without code review, because I was on vacation.

    Fast forward 2 months, and I get to fix the mess. Mainly reorganizing the internal data structures to match the new threading model.

    Now, as part of this change, a perfectly functional variable-length message queue was replaced by a fixed-length ring buffer, because ring buffers are far superiour because they do not require locking. Not that I've ever seen supporting evidence for that being a bottleneck. Also discounting all the new globally locked reference counters.

    Now, after spending all of today trying to figure out why I was getting inconsistent data structures at the receiving end, I discovered what he decided to do when the ring buffer is full: Discard the message, leaking any pointers left therein, without so much as an error message.

    Someone's going to have a good talking-to tomorrow morning...



  • And then you will have lots of free time!


  • Java Dev

    Nah, he doesn't have the clout. And I'm going to be nice about it.



  • @PleegWat said:

    my boss ... rewrote

    Danger, Will Robinson!!!




Log in to reply