Re: [Live-devel] triggerEvent() race condition

2015-03-16 Thread Ross Finlayson
> Having thought about it some more, I don't think it's enough to just protect > calls to triggerEvent() because 'fTriggersAwaitingHandling' is still modified > by BasicTaskScheduler::SingleStep(). The intention of the code that implements “BasicTaskScheduler” was that: 1/ The event loop code (w

Re: [Live-devel] Windows build - undefined symbols

2015-03-16 Thread Robert Smith
Now that I've had the time to look into it I've figured out what it was. I'm compiling with -DWIN32_LEAN_AND_MEAN which causes #include to be excluded from Windows.h (amonst other things). ole2.h #includes and objbase.h #includes So presumably noone else has compiled with -DWIN32_LEAN_AND_M

Re: [Live-devel] triggerEvent() race condition

2015-03-16 Thread Robert Smith
Maybe it's atomic on a single core CPU but it's not going to be safe with multicore CPU's. Having thought about it some more, I don't think it's enough to just protect calls to triggerEvent() because 'fTriggersAwaitingHandling' is still modified by BasicTaskScheduler::SingleStep(). I'm not j

Re: [Live-devel] Windows build - undefined symbols

2015-03-16 Thread Ross Finlayson
> Sorry, the actual message is "identifier not found", "undefined symbol" was a > product of my faulty memory. OK, please post the *exact* error messages that you see when compiling each specific file (and note which file is being compiled in each case). (If the error messages instead occur dur

Re: [Live-devel] Windows build - undefined symbols

2015-03-16 Thread Robert Smith
Sorry, the actual message is "identifier not found", "undefined symbol" was a product of my faulty memory. I understand that noone else has seen this problem, but it's faulty logic to suggest that these files don't need to include stdlib.h.. if it's compiling it just means that stdlib.h has be

Re: [Live-devel] triggerEvent() race condition

2015-03-16 Thread Ross Finlayson
> But I can't see how the implementation of triggerEvent() can be thread safe, > e.g, the last line: > > fTriggersAwaitingHandling |= eventTriggerId; > > must load, modify and store the value at fTriggersAwaitingHandling It depends on the CPU architecture. In many (if not most?) architectures,

Re: [Live-devel] Windows build - undefined symbols

2015-03-16 Thread Ross Finlayson
> But I don't think it's unreasonable for files to include the headers that > define the symbols they use so maybe worth adding stdlib.h to the files that > need it? But I have no evidence that these file ‘need’ to #include ‘stdlib.h’. If they did, then they wouldn’t *compile*. 'Undefined sym

[Live-devel] triggerEvent() race condition

2015-03-16 Thread Robert Smith
I have been diagnosing an issue on a client's system which is streaming six live encoded H264 streams vis multicast RTP and I think the problem lies in the triggerEvent() method. The problem is that some of the streams just stop after a while. I added extensive tracing to our code and identifi

Re: [Live-devel] Windows build - undefined symbols

2015-03-16 Thread Robert Smith
Ok, so it must be something specific to my build configuration, when I have time I'll look into it deeper. But I don't think it's unreasonable for files to include the headers that define the symbols they use so maybe worth adding stdlib.h to the files that need it? Robert. On 03/12/2015 03