In this forum it has been made clear that TeeChart is not thread safe in a sense that data in series or TeeChart cannot be updated from other threads if TeeChart is being drawn.
Is it possible and safe however to update data in series and add new series from multiple threads if TeeChart is not being drawn i.e. automatic drawing is disabled and drawing is requested by client code? Is TeeChart’s series object container class access thread safe f.ex. by using critical sections in TeeChart code? I am aware that handling series removal from TeeChart if multiple threads are running is a bit of a challenge for client code because series’ indexes may change as a result but if we dismiss that and assume that adding a new series to TeeChart is not changing existing series’ indexes i.e. new series are always added to the tail of the TeeChart’s series object container class, is this scenario possible?
We are using TeeChart Pro v8 ActiveX control.
TeeChart v8 and multithreading
Re: TeeChart v8 and multithreading
Hello,
Yes, disabling the AutoRepaint feature you can use semaphores (or any other threading technique) to safely add points or series in a thread, and repaint the chart in another thread. You just have to make sure both actions won't be made at the same time.
Don't hesitate to let us know if you find any problem implementing it.
Yes, disabling the AutoRepaint feature you can use semaphores (or any other threading technique) to safely add points or series in a thread, and repaint the chart in another thread. You just have to make sure both actions won't be made at the same time.
Don't hesitate to let us know if you find any problem implementing it.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
-
- Newbie
- Posts: 2
- Joined: Wed Nov 07, 2007 12:00 am
Re: TeeChart v8 and multithreading
Thank you for the information. One additional question: is it safe to add points to different series from multiple worker threads simultaneously if the painting is disabled?
We are planning to create a thread pool where each thread adds points to a single series to speed up the graph updating for large amounts of data.
We are planning to create a thread pool where each thread adds points to a single series to speed up the graph updating for large amounts of data.
Re: TeeChart v8 and multithreading
Hello,
Only the functions are linked to a series, which at the same time are linked to source series.
I think it should. In general, different series don't have relations between them.jhameenniemi wrote:is it safe to add points to different series from multiple worker threads simultaneously if the painting is disabled?
Only the functions are linked to a series, which at the same time are linked to source series.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |