Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

Crash

Hi,

some months ago I made a program in C++ in MicroC/OS-II installed on FPGA programmed with NIOS processor on Altera board.

The software was composed of three threads that made nothing: in each thread there was only a cout and before each cout a semaphore was brought and then, after the cout, the semaphore was released. The three threads was synchronized by semaphores.

If the thread was named A, B, C:

1) A run, B and C aspected

2) A released a semaphore, B took the semaphore and run; A and C aspected

3) B release a semaphore, C took the semaphore and run; A and B aspected

4) C release a semaphore, A took the semaphore and run; B and C aspected

and so on...

After two hours the program crashed, and this fact happened every time that I launched the program, and I didn't understand why.

Is there someone that has an idea?

Thank you very much

18 Replies