CRITICAL SECTION slow down the performance


i need use synchronization mechanism between 2 threads of single process, have used critical section has drastically slow down execution of code, although apart of use of critical section related api's in 2 threads code has no other performance impacting use, can share how use synchronization mechanism in windows ? same part have used under linux use of `mutex` working fine.

critical_section cs;

initializecriticalsection(cs);

thread-1                                                                 thread-2

while(1) {                                                            while(1) {

entercriticalsection(&cs);                                      tryentercriticalsection(&cs);

....                                                                          ....

leavecriticalsection(&cs);                                      leavecriticalsection(&cs);

}                                                                          }

task of threads manipulate networking read/write stuff.

i have used nat(network address translation ethernet interfaces , threads manipulating 1 of interface) in windows xp, required purposefully .

hi, 

i recommend ask question in msdn forum help.

msdn forum: http://social.msdn.microsoft.com/forums/en-us/categories/

i hope issue can resolved soon.

best regards,



Windows Server  >  Platform Networking



Comments

Popular posts from this blog

CRL Revocation always failed

Failed to query the results of bpa xpath

0x300000d errors in Microsoft Remote Desktop client