thread and trend

I use a thread (priority 11) witch put data every 5ms in a trend.
The thread use PtEnter() and PtLeave() to modify trend ressource.

All work fine.

But when I move the window (priority 10) with the mouse, scrolling go
slower.

Why and how eliminate the problem ?

When you move the window, Photon accesses the widgets of your program, doing
a PtEnter() itself. So your thread will be delayed at that point - your call
to PtEnter() waits, and your timing is spoiled.
Better, in your thread, write the data in a buffer. Then use a timer
callback or a workproc to update the trend with all the data that was
created in the buffer the meantime.
Markus


“bruno suarez” <bruno.suarez@scola.ac-paris.fr> wrote in message
news:3A856ECA.6945B348@scola.ac-paris.fr

I use a thread (priority 11) witch put data every 5ms in a trend.
The thread use PtEnter() and PtLeave() to modify trend ressource.

All work fine.

But when I move the window (priority 10) with the mouse, scrolling go
slower.

Why and how eliminate the problem ?