We need to make sure threads are working well on our system
There are two examples that can be used for testing it:
- https://en.cppreference.com/w/cpp/thread/call_once
- https://cplusplus.com/reference/condition_variable/condition_variable/
The second one seems to work fine with both clib2 and newlib.
The first one though is not working as expected.
It is expected to have the following output
Simple example: called once
throw: call_once will retry
throw: call_once will retry
Didn't throw, call_once will not attempt again
but it prints only the first two lines and then the CPU goes to 100% and remains like that
The way I compiled them:
ppc-amigaos-g++ -std=c++0x -pedantic -athread=native -o callonce_newlib callonce.cpp
ppc-amigaos-g++ -mcrt=clib2 -std=c++0x -pedantic -athread=native -o callonce_clib2 callonce.cpp
ppc-amigaos-g++ -std=c++0x -pedantic -athread=native -o conditionvariable_newlib conditionvariable.cpp
ppc-amigaos-g++ -mcrt=clib2 -std=c++0x -pedantic -athread=native -o conditionvariable_clib2 conditionvariable.cpp
We need to make sure threads are working well on our system
There are two examples that can be used for testing it:
The second one seems to work fine with both clib2 and newlib.
The first one though is not working as expected.
It is expected to have the following output
but it prints only the first two lines and then the CPU goes to 100% and remains like that
The way I compiled them: