[Live-devel] Possible concurrency issue with triggerEvent()
Hansen Jan Rørgård
jan.r.hansen at dk.saabgroup.com
Wed May 31 06:28:00 PDT 2023
Hi,
In the liveMedia FAQ section it is written:
"(Note that "triggerEvent()" is the only LIVE555 function that may be called from an external (i.e., non-LIVE555) thread.)".
We use this possibility and trigger an event from a non-LIVE555 thread. Sometimes an the event "disappears" ie. it is signalled using triggerEvent() but the eventHandler is not called. The LIVE555 changelog has the following entry:
2015.03.16:
- Made a small change to the "BasicTaskScheduler" implementation to reduce the likelihood of
a race condition with external thread(s) calling "triggerEvent()".
Is it correct that there is a non-zero possibility, that the event will disappear due to the variables BasicTaskScheduler0::fTriggersAwaitingHandling and BasicTaskScheduler0::fTriggeredEventClientDatas being accessed concurrently by the LIVE555 thread and a non-LIVE555 thread?
The behaviour is not immediately obvious from the FAQ and the function description, but we think it is what we "see" and a workaround to re-trigger the event at a later time seems to work for now.
Do you also see an issue here?
virtual void triggerEvent(EventTriggerId eventTriggerId, void* clientData = NULL) = 0;
// Causes the (previously-registered) handler function for the specified event to be handled (from the event loop).
// The handler function is called with "clientData" as parameter.
// Note: This function (unlike other library functions) may be called from an external thread
// - to signal an external event. (However, "triggerEvent()" should not be called with the
// same 'event trigger id' from different threads.)
Best Regards
Jan Rørgaard Hansen
Lead Software Developer
Communication Solutions
Business Area Surveillance
Tel.: + 45 3638 3000
Call me on: Skype<skype:jan.r.hansen at dk.saabgroup.com?call>
E-mail: jan.r.hansen at dk.saabgroup.com<mailto:jan.r.hansen at dk.saabgroup.com>
[Saab_rgb_150px]
Saab Danmark A/S
Porten 6
DK - 6400 Sonderborg
www.saabgroup.com<http://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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20230531/c5f531d2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 1998 bytes
Desc: image001.jpg
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20230531/c5f531d2/attachment.jpg>
More information about the live-devel
mailing list