DefaultProgressMon - is it thread safe?  SOLVED

PDF-XChange Editor SDK for Developers

Moderators: TrackerSupp-Daniel, Tracker Support, Paul - Tracker Supp, Vasyl-Tracker Dev Team, Chris - Tracker Supp, Sean - Tracker, Ivan - Tracker Software, Tracker Supp-Stefan

Forum rules
DO NOT post your license/serial key, or your activation code - these forums, and all posts within, are public and we will be forced to immediately deactivate your license.

When experiencing some errors, use the IAUX_Inst::FormatHRESULT method to see their description and include it in your post along with the error code.
Post Reply
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

DefaultProgressMon - is it thread safe?

Post by zarkogajic »

Hi Support,

Double checking: is Inst.DefaultProgressMon thread safe?

Can I do, for example, Inst.ProgressMon.SetText() from multiple threads?

p.s.
it seems it is - but one is never too certain of what's under the hood of a black box :)

-žarko
User avatar
Vasyl-Tracker Dev Team
Site Admin
Posts: 2352
Joined: Thu Jun 30, 2005 4:11 pm
Location: Canada

Re: DefaultProgressMon - is it thread safe?

Post by Vasyl-Tracker Dev Team »

Hi, -žarko

Yes, you can use the Inst.DefaultProgressMon from multiple threads as well.
But note: with Pos, Duration, Start, Stop - even each is thread safe - you need to 'synchronize' shared using of that methods across multiple threads. For example the setting the Pos to different values from different threads may cause jumping the running progress bar back-forward. So if you planning to show one common progress for multiple parallel tasks - you need to implement your own 'accumulator' for all progress-ticks from that tasks and then put t each new accumulated value to the Inst.DefaultProgressMon.Pos, and you can do it in any thread for sure.

HTH.
Vasyl Yaremyn
Tracker Software Products
Project Developer

Please archive any files posted to a ZIP, 7z or RAR file or they will be removed and not posted.
zarkogajic
User
Posts: 1370
Joined: Thu Sep 05, 2019 12:35 pm

Re: DefaultProgressMon - is it thread safe?  SOLVED

Post by zarkogajic »

Thanks Vasyl,

All clear.

Sasha - Tracker Dev Team
User
Posts: 5522
Joined: Fri Nov 21, 2014 8:27 am
Contact:

DefaultProgressMon - is it thread safe?

Post by Sasha - Tracker Dev Team »

:)
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
Post Reply