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
DefaultProgressMon - is it thread safe? SOLVED
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.
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.
-
- User
- Posts: 1371
- Joined: Thu Sep 05, 2019 12:35 pm
- Vasyl-Tracker Dev Team
- Site Admin
- Posts: 2353
- Joined: Thu Jun 30, 2005 4:11 pm
- Location: Canada
Re: DefaultProgressMon - is it thread safe?
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.
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.
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.
-
- User
- Posts: 1371
- Joined: Thu Sep 05, 2019 12:35 pm
Re: DefaultProgressMon - is it thread safe? SOLVED
Thanks Vasyl,
All clear.
-ž
All clear.
-ž
-
- User
- Posts: 5522
- Joined: Fri Nov 21, 2014 8:27 am
- Contact:
DefaultProgressMon - is it thread safe?
Subscribe at:
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ
https://www.youtube.com/channel/UC-TwAMNi1haxJ1FX3LvB4CQ