many fixes and improvements
- add sem count width config
- add check to SAFE
- add thread dynamic deletion
- add sem dynamic deletion
- improve timer
- fix queue management
update config template