A effective critical section has been implemented in multi threading program that ensures no race conditions or deadlocks.
1)First all the linux commands will be handy here,if not linux you should load your own text file and change in the code, name of your input text file in main function in one of the paramaters in fopen.
2)After loading of text file compiling must be done by using Linux commands or in accordance with your compiler.
3)Next,if Linux is your compiler, then beside ./a.out you should mention your required thread numbers to process.
4) Program will be executed and a global hashmap of all charecters count of a file will be generated without any race or deadlocks conditions.
with effective usage of Mutex locks in correct positions we can avoid race and deadlocks conditions over a shared memory.