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

skynet-src/skynet_mq.c racing condition #37

Closed
jigsawecho opened this issue Sep 11, 2013 · 3 comments
Closed

skynet-src/skynet_mq.c racing condition #37

jigsawecho opened this issue Sep 11, 2013 · 3 comments

Comments

@jigsawecho
Copy link

Memory barrier is not properly used, which introduces potential racing condition.
There are several issues listed below:

  1. Full barrier at line 57 CAN be replaced with a write barrier.
  2. Full barrier at line 59 is not needed at all.
  3. Full barrier at line 80 is not needed at all
  4. Read barrier MUST be inserted before line 75.
@cloudwu
Copy link
Owner

cloudwu commented Sep 11, 2013

Thanks,
It seems that there is no build-in write barrier in C. How can I replace a write barrier ?

http://gcc.gnu.org/onlinedocs/gcc-4.1.0/gcc/Atomic-Builtins.html

.

cloudwu added a commit that referenced this issue Sep 11, 2013
@jigsawecho
Copy link
Author

@cloudwu
Copy link
Owner

cloudwu commented Sep 11, 2013

I would like use build-in function rather than asm code :)

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

No branches or pull requests

2 participants