Operating System - Linux
1753805 Members
7329 Online
108805 Solutions
New Discussion юеВ

std::exception "thread synchronization error"

 
Vadim Yezhakov
Advisor

std::exception "thread synchronization error"

Hi.
I compile and link my multithread application with -D_REENTRANT -D_RWSTD_MULTI_THREAD -lpthread options.
All shared libraries, used by my application, are compiled and linked with this options too.

But sometime, std:exception "thread synchronization error" are throws, when i use objects from std library (string, list etc.)
3 REPLIES 3
Vadim Yezhakov
Advisor

Re: std::exception "thread synchronization error"

Can anybody help me?
Sameer_Nirmal
Honored Contributor

Re: std::exception "thread synchronization error"

Hi,

I do suspect the problem could be resource contention causing synchronization error.

You might be getting EAGAIN/ENOMEM errors. You need to make sure the application is
well designed to do the cleanup , i. e. cleanup of non-required threads along with their resources like mutex, semaphores , locks etc.

Depending on the application requirments , certain kernel parameters may be required to tune up to make available OS resources to the application.
Dennis Handly
Acclaimed Contributor

Re: std::exception "thread synchronization error"

This error indicates you haven't consistently compiled with -mt.

Contrary to what Sameer says, it has nothing to do with resource contention".

There is a problem with PHSS_32573 and PHSS_31855 that would cause false instances of this problem if your shared libs were created incorrectly.