Code Monkey home page Code Monkey logo

blog's People

Contributors

avbelov23 avatar jeffreypicard avatar jpalider avatar krizhanovsky avatar michael-grunder avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

blog's Issues

two question

Hi @krizhanovsky

Thank you for your nice work.

Here is my two question harassing my brain,

  • what does the // Force compiler to use tmp_h exactly once. mean? Need here a compiler barrier?
  • Should memory barrier be inserted before thr_pos().head = ULONG_MAX; and thr_pos().tail = ULONG_MAX;, after the specified element read / written?

Licensing

Can you add license text to some of the examples? Currently, it's unclear as to what their licenses are.

Parking value not exclude // Wrap around not handled

Please forgive me if I'm missing something here...

in lockfree_rb_q.cc class LockFreeQueue, there appear to be two issues related to ulong overflow (wrap around).

  1. the ULONG_MAX "parking value" is not excluded from reservation, nor from "min" testing. the "invalid" value can't ever be used as a valid value, nor compared with them

  2. the comparison for min testing will be incorrect if the span of thread specific head and tail values crosses overflow

There appear to be two choice -- compared the signed distance, If the max difference is representable in long, will give the correct comparison (if the difference isn't, then one push of pop isn't making forward progress... or you have more than 2 billion threads)

( 0 < long(min - tmp_[ht})

Slightly more robust (it could handle a ULONG_MAXth old pending request :) ) would be comparing the head - tail values -- guaranteed to be positive and correctly comparable -, though eventually a hung push or pop operation would stall all operations.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.