eclipse-iceoryx / iceoryx

Eclipse iceoryx™ - true zero-copy inter-process-communication
https://iceoryx.io
Apache License 2.0
1.69k stars 393 forks source link

A Small Mistake in lockfree_queue.md #2341

Open StaRadian opened 2 months ago

StaRadian commented 2 months ago

There is a minor typo in the Pop Operation section of the iceoryx/doc/design/lockfree_queue.md document, where the state of the queue after a pop operation is incorrectly illustrated. Specifically, the positions of x and y are swapped.

Current Document:

Pop Operation

Pop reads the value at the index of head and returns it if the cycle matches Heads cycle and a CAS to increase head by 1 succeeds.

[ (c,?), (c,y), (c,x), (c-1,?) ]   H=(c,1)     T=(c,3)

pop returns y

[ (c,?), (c,x), (c,y), (c-1,?) ]   H=(c,2)     T=(c,3)

Corrected Document:

Pop reads the value at the index of head and returns it if the cycle matches Heads cycle and a CAS to increase head by 1 succeeds.

[ (c,?), (c,x), (c,y), (c-1,?) ]   H=(c,1)     T=(c,3)

pop returns y

[ (c,?), (c,x), (c,y), (c-1,?) ]   H=(c,2)     T=(c,3)

Thank you.

elBoberido commented 2 months ago

@StaRadian do you want to create a PR to fix it. You would need to sign the Eclipse Contributor Agreement. If you don't want to run through all the hoops for this little change, I can also fix it in my next PR.

StaRadian commented 2 months ago

@elBoberido I didn’t realize I could become a contributor, so thank you for letting me know! I'm still a newbie as a programmer, I’ll give it a try. :D Thanks!

elBoberido commented 2 months ago

@StaRadian sure, go ahead. I'll reopen the issue since you need an issue number for your commit.

Please have a look at the 8 steps from the following link. https://github.com/eclipse-iceoryx/iceoryx/blob/main/CONTRIBUTING.md#feature-request-and-bugs Since iceoryx is used in safety-critical environments, we have to follow more strict rules like you might know from other projects. One of these rules is to ensure traceability, which we do by assigning issue numbers to commit, among other things.

StaRadian commented 2 months ago

Thanks for the information. I’m currently reviewing the 8 steps in the link you provided and will make sure to fully understand them before proceeding. I recognize the importance of following the strict rules, especially for a project like iceoryx. Thanks

elBoberido commented 3 weeks ago

@StaRadian are you still on this? If not, I can fix the documentation mistake with one of my next PRs.