Project Home
Project Home
Trackers
Trackers
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Performance issues when using conditional variables in QNX7: (1 Item)
   
Performance issues when using conditional variables in QNX7  
Hi,

I notice issues when using notify_all() in conditional variables in QNX7 compare to others platforms like Linux. Causing
 in some cases to couple of milliseconds lost during a cycle. The program in question has over 100 conditional variables
 and can run in single or multi-thread by configuration but the conditional variable are not disabled or skipped when 
using single thread. There is noticeable lost time when calling multiple notify_all() in single threaded executions.

In QNX, std::condition_variable::notify_all() calls SyncCondvarSignal() that emits a system call that is clearly visible
 in the Kernel Tracing and Enter and Exit that takes a couple of microseconds usually 5us or more. When measuring using 
the attached cpp file without Kernel Tracing it takes about 1us. Compare to Linux it seems to be about 100 or 1000 
slower where it is around 5ns.

Why notify_all() even when no threads are waiting for that signal takes so long? Is there any good reference on internal
 implementation in the kernel and expected performance for these system calls? What is the impact of kernel tracing on 
the performance of system calls like the ones from conditional variables?

Thanks

Attachment: Text bench_cond_var.cpp 572 bytes