[Live-devel] [EXTERNAL] Re: Possible issue in DelayQueue

Hansen Jan Rørgård jan.r.hansen at dk.saabgroup.com
Thu Jan 12 23:38:19 PST 2023


Thank you very much for the quick response and the new version.

Best Regards

Jan Rørgaard Hansen
Lead Software Developer
Communication Solutions
Business Area Surveillance

Tel.:  + 45 3638 3000
Call me on: Skype
E-mail: jan.r.hansen at dk.saabgroup.com





Saab Danmark A/S
Porten 6
DK – 6400 Sonderborg                        
www.saabgroup.com

This e-mail is private and confidential between the sender and the addressee. 
In the event of misdirection, the recipient is prohibited from using, copying or 
disseminating it or information in it. Please notify the above if any misdirection.


-----Original Message-----
From: live-devel <live-devel-bounces at us.live555.com> On Behalf Of Ross Finlayson
Sent: 11. januar 2023 20:20
To: LIVE555 Streaming Media - development & use <live-devel at us.live555.com>
Subject: [EXTERNAL] Re: [Live-devel] Possible issue in DelayQueue



> On Jan 11, 2023, at 8:59 AM, Hansen Jan Rørgård <jan.r.hansen at dk.saabgroup.com> wrote:
> 
> Hi,
>  In the liveMedia FAQ section: ”Is this code 'thread safe'? I.e., can it be accessed by more than one thread at the same time?”, it is stated that:
> “…Another possible way to access the code from multiple threads is to have each thread use its own "UsageEnvironment" and "TaskScheduler" objects, and thus its own event loop.”
>  I know that it is not recommended to use this approach

Yes, and you discovered a reason why: The code might inadvertently make use of shared (or static) variables that can cause problems with multiple threads :-)


> Do you also see an issue here?

Yes.  I have just installed a new version (2023-01-11) of the code that moves the ’token counter’ to be a field of the ’task scheduler’ object, so that it will no longer be shared by multiple threads.  This should avoid this problem.

Thanks for the report.


Ross Finlayson
Live Networks, Inc.
http://www.live555.com/


_______________________________________________
live-devel mailing list
live-devel at lists.live555.com
http://lists.live555.com/mailman/listinfo/live-devel



More information about the live-devel mailing list