Skip to content

Commit

Permalink
Replaced moodycamel::ConcurrentQueue with tbb::concurrent_queue in Sa…
Browse files Browse the repository at this point in the history
…lmonQuantify

There seems to be a bug in the moodycamel::ConcurrentQueue (cameron314/concurrentqueue#12)
that, under very high contention, can result in an out-of-bounds memory
access and segfault.  This was happening on the test data where, due to
its very small size, the queue was coming under very heavy contention.
The crash was not deterministic, but replacing the moodycamel queue
with the tbb queue seems to have resolved the issue in all cases.  In
the future, I'd like to move back to the moodycamel variant, as it
allows bulk enqueue/dequeue operations, and is thus faster.  However,
the tbb implementation will remain in place until the moody camel bug is fixed.
The old code remains in SalmonQuantify.cpp (commented out) so that it
will be easy to re-enable when the bug is finally fixed.
  • Loading branch information
rob-p committed Feb 16, 2015
1 parent 2a61f49 commit 2dd432e
Show file tree
Hide file tree
Showing 2 changed files with 161 additions and 37 deletions.
4 changes: 4 additions & 0 deletions include/AlignmentGroup.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ template <typename FragT>
class AlignmentGroup {
public:
AlignmentGroup() : read_(nullptr) { alignments_.reserve(10); }
AlignmentGroup(AlignmentGroup& other) = delete;
AlignmentGroup(AlignmentGroup&& other) = delete;
AlignmentGroup& operator=(AlignmentGroup& other) = delete;
AlignmentGroup& operator=(AlignmentGroup&& other) = delete;

void setRead(std::string* r) { read_ = r; }
std::string* read() { return read_; }
Expand Down
Loading

0 comments on commit 2dd432e

Please sign in to comment.