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

A bug with thread #11

Open
GoogleCodeExporter opened this issue Mar 20, 2015 · 0 comments
Open

A bug with thread #11

GoogleCodeExporter opened this issue Mar 20, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

What steps will reproduce the problem?
1. input a image, and get the result.
2. input the same image, and get the result.
3. do it(2) many times, and compare the results.

What is the expected output? What do you see instead?
The results should be same, but they are not.

What version of the product are you using? On what operating system?
Src Seam Carving GUI 1.11, CAIR 2.19, Ubuntu LTS 12.04.

Please provide any additional information below.
    I solved the problem, and I provide the diff file.
    In CAIR, there are 4(you can set a different number) threads. They work together to do the same work. The main thread do 'sem_post' 4 times, and each worker thread do 'sem_wait' to get a semaphore to work. There is posibility that one worker may finish the work extreme fast and do 'sem_wait' again before other worker has a turn to run on cpu. For example, worker 0 calc energy on image block 0, worker 3 calc energy on image block 3, worker 2 calc energy on image block 2, worker 3 calc energy on image block 3. In this example worker 1 didn't work, and worker 3 worked twice.
    I'm sorry for my poor English. I hope you can understand what I said. That's all.

Original issue reported on code.google.com by gfateext...@gmail.com on 16 Jan 2014 at 7:26

Attachments:

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

No branches or pull requests

1 participant