Skip to content

Unclear problem in 'Reusable barrier problem #1' #9

@viralmutant

Description

@viralmutant

The problem described in the Section 3.7.2 for the non-solution in 3.7.1 is

If the n − 1th thread is interrupted at this point, and then the nth thread
comes through the mutex, both threads will find that count==n and both
threads will signal the turnstile. In fact, it is even possible that all the threads
will signal the turnstile.

Isn't this also true for the working solution described in 3.6.4 ? The text under that head says

It might seem dangerous to read the value of count outside the mutex. In
this case it is not a problem
Isn't that the same problem described in section 3.7.2 ?
What would be the problem if all the threads signal but none of them is in wait yet ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions