Im using a simple thread safe queue of tasks, that can be seen in this post : C Pthreads - issues with thread-safe queue implementation
When the program was only about loading the queue with a bunch of tasks and performing them concurrently, the cpu usage was well distributed between all cores as shown by htop and the monitoring system (60 ~ 70% for each core).
When i added some heavy file reading (sequentially) at the beginning of the code, and executed the exact same parallel tasks, the cpu usage got concentrated in one of the cores (100%) during all execution. Can someone help me figure out what is happening? Thanks.