i have two threads, they run pretty fast, i'm using pthread_mutex_lock and pthread_mutex_unlock to access global (externed variables) data
the problem is that my application takes about 15-20% of CPU running on Ubuntu Linux,
the same code but with EnterCriticalSection and LeaveCriticalSection and running on Windows uses 1-2% of CPU