SimConnectModule.ReceiveMessage() cost too much time

For topics related to the creation of simulation objects (SimObjects). This includes development of aircraft, ground, and maritime vehicles.
Locked
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

SimConnectModule.ReceiveMessage() cost too much time

Post by ppp333ddd_ »

Hi,

I am using simconnect for C# WPF programming. My program just simply reads some values from P3D. Previously it is ok, but recently the program can only run for 2-3 seconds and then becomes extremely slow and finally no response at all. When I debug it, I found that in the function HandleSimConnectEvents, the time consumed for the function SimConnectModule.ReceiveMessage increased significantly each time. After about 3 times loop, it consumed over 1 minute's time and caused ContextSwitchDeadLock exception. Does anyone know why the function SimConnectModule.ReceiveMessage consumes much more time each time?

Thanks a lot

Jeff
ppp333ddd_
Posts: 58
Joined: Fri Aug 18, 2017 1:04 am

Re: SimConnectModule.ReceiveMessage() cost too much time

Post by ppp333ddd_ »

Hi,

The problem is that I used 2 different ways for reading data which caused conflict in the thread I guess.

Thanks,

Jeff
Locked