Giter Club home page Giter Club logo

Comments (4)

jprotze avatar jprotze commented on August 13, 2024

@LChenGit can you explain, why this code is marked as having a data race? The locking pattern really looks like in DRB186-barrier2-no.c. Thread 0 cannot pass until Thread 1 releases l1 and Thread 1 cannot pass until Thread 0 releases l0.
Did you mean to comment l1?

In addition, the code would have way more data race pairs than listed - if the barrier would not synchronize. Both threads read x in lines 99 and 106.

from dataracebench.

jprotze avatar jprotze commented on August 13, 2024

Ok, as soon as thread 0 releases l0, thread 1 can run through multiple barrier_wait cycles, so that both threads can actually end up in any epoch concurrently. Besides the data race, this can actually can lead to a deadlock.

With the printf statements in the code, any pair of conflicting read/write accesses should be listed in the comment.
I also suggest to include a better description of the issue in the comment.

from dataracebench.

jprotze avatar jprotze commented on August 13, 2024

I updated #151 to provide this description and added the missing data race pairs

from dataracebench.

LChenGit avatar LChenGit commented on August 13, 2024

Hi,

Sorry for the late reply. I was communicating with the original author for this code. We tried with CIVL and here is the output:

Thread 0: phase 1, i=0, x=1
Thread 1: phase 1, i=0, x=1
t0 released l0
t1 obtained l0
t1 released l1
t1 released l0
t1 obtained l1
t1 obtained l0
t1 released l1
t1 released l0
t1 obtained l1
Thread 1: phase 3, i=0, x=1
t1 obtained l0
t1 released l1
t1 released l0
t0 obtained l1
t0 obtained l0
t0 released l1
Thread 0 wrote
t1 obtained l1
Thread 1 wrote
Data-race detected: {x} written by thread 1 intersects {x} written by thread 0

We also used inspector to test the code and inspector reported no data race.

I think your comment matches the CIVL output.

from dataracebench.

Related Issues (20)

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.