Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best effort FIFO MPMC queue #99

Open
qwwdfsad opened this issue Mar 23, 2016 · 2 comments
Open

Best effort FIFO MPMC queue #99

qwwdfsad opened this issue Mar 23, 2016 · 2 comments

Comments

@qwwdfsad
Copy link
Contributor

From Cliff Click JavaOne talk (see slides 51-53)

As far as I know there is no such queue implementations (neither in high scale lib nor anywhere else), so JCTools seems like a perfect place for it.

@nitsanw
Copy link
Contributor

nitsanw commented Mar 23, 2016

Interesting idea, a PR would be a great step towards evaluating the benefit. I've not seen hard numbers/implementations to support the idea.

@ekuvardin
Copy link

From Cliff Click JavaOne talk (see slides 51-53)

So I found this idea very interesting. But does anyone have this presenation and what is the main idea? Even https://web.archive.org/ couldn't find it. I waste a lot of time and couldn't find any pdf. To save this issue for future explorers and don't close it due to lose pdf I leave this piece of code below(author read the original paper and wrote some pseudocode)
http://dev.cheremin.info/2011/08/highly-scalable-java-3.html (for those who can read russian)

while( !CAS( items[producerLocalIndex], null, newItem ) ){
  producerLocalIndex = ( producerLocalIndex + 1 ) % items.length; 
}
do{
  consumerLocalIndex = ( consumerLocalIndex + 1 ) % items.length;
  item = items[consumerLocalIndex];
} while( !CAS( items[consumerLocalIndex], item, null ) );
return item;

But I think it more likely first in random out then FIFO according to code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants