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

Deadlock when using stdin #6

Open
Procrat opened this issue May 17, 2016 · 1 comment
Open

Deadlock when using stdin #6

Procrat opened this issue May 17, 2016 · 1 comment

Comments

@Procrat
Copy link

Procrat commented May 17, 2016

The program sometimes hangs when I try to read from stdin.

I'm not fully familiar with the code, but I think the problem is that this sem_wait gets called multiple times because it's in a loop, but the semaphore only gets unlocked once. (In a particular run, that sem_wait was called two times but, this sem_poll only got called once.)

@dongjaek
Copy link
Contributor

I suggest that you try a fork and a pull request for faster service.
On May 17, 2016 12:11 PM, "Stijn Seghers" notifications@github.com wrote:

The program sometimes hangs when I try to read from stdin.

I'm not fully familiar with the code, but I think the problem is that this
sem_wait

sem_wait(sema_w);

gets called multiple times because it's in a loop, but the semaphore only
gets unlocked once. (In a particular run, that sem_wait was called 2
times but, this sem_poll
sem_post(sema_w);

only got called once.)


You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
#6

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