Skip to content

MultProducerSequencer.setAvailable(): difference to java version #19

@bogdad

Description

@bogdad

Hey,

thank you for the port!
I was comparing to java version, and feels MultProducerSequencer.setAvailable() has different visibility properties?

void setAvailableBufferValue(std::int32_t index, std::int32_t flag)
{
    m_availableBuffer[index] = flag;
}

vs https://github.com/LMAX-Exchange/disruptor/blob/95c705f60c1833b07f1fed6e08a08d7bee7f0971/src/main/java/com/lmax/disruptor/MultiProducerSequencer.java#L235

    private void setAvailableBufferValue(final int index, final int flag)
    {
        AVAILABLE_ARRAY.setRelease(availableBuffer, index, flag);
    }

setRelease (the docs say) is roughly equivalent to m_atomic_int.store(..., std::memory_order_release);

the cpp version does not have the release memory semantics? I cant see why its not needed in c++ version, do you know?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions