Code Monkey home page Code Monkey logo

Comments (6)

kyeongmincho avatar kyeongmincho commented on September 23, 2024 2

@efenniht
Actually I meant maybe there shoud be a constraint that t cannot be written on the other threads, but yes, I agree with you!

from cs431.

jmpasta avatar jmpasta commented on September 23, 2024

I found that problem 19 is already asked in the other question(#9), but I confused that how message passing works. I think y=42 should means that x=42. But, how to enforce it?

from cs431.

jeehoonkang avatar jeehoonkang commented on September 23, 2024

On test case 3: Thread 1 is able to read different values from x for r1 and r2 thanks to Thread 3, but Thread 1 is also able to read the same value from x for r1 and r2. Certification requires the ability---not necessity---to fulfill the thread's promises, and the promise to write y=1 is justified by the certification in which Thread 1 reads the same value from x for r1 and r2.

from cs431.

efenniht avatar efenniht commented on September 23, 2024

FYI, my interpretation of "join thread" is:

join thread 2                     || x = 1
r1 = x
~>
while (t.load(acquire) == 0) {}   || x = 1
r1 = x                            || t.store(1, release)

where t is initialized with 0.

from cs431.

kyeongmincho avatar kyeongmincho commented on September 23, 2024

@efenniht
You mean, of course, "where t is also a unique virtual variable that only exists on the pair of joinee-joiner threads?

from cs431.

efenniht avatar efenniht commented on September 23, 2024

@drzix, I think it's enough that such t exists for each joinee thread:

a = 1 || join thread 1 || join thread 1
~>
a = 1                || while (t.load(acquire) == 0) {} || while (t.load(acquire) == 0) {}
t.store(1, release)

from cs431.

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.