[Live-devel] RTSP threads vs event loop [was: RTSP customization]

Juan Manuel Lopez Baio jmbaio at gmail.com
Thu Aug 24 07:14:09 PDT 2006


On 8/23/06, Ross Finlayson <finlayson at live555.com> wrote:
> >The event loop is run in its own thread, and the main thread creates
> >the MediaSessions and adds them to the RTSPServer as needed.
>
> This will work only if the "main thread" is also your event loop
> thread.  This is explained very clearly (I thought) in the FAQ.

yeah, I guess it is, I just misinterpreted it.
I'd like to point out that I'm not married to threads, in fact I had
read in the past
http://www.softpanorama.org/People/Ousterhout/Threads/tsld001.htm and
thought he made a good point; but, you know, sometimes we don't have
that many choices, and this project is being handled with threads so I
must adapt my tools the best I can.

> If you want to have a periodic task that scans the file system for
> new files, then you must do this within the event loop (thread),
> using "scheduleDelayedTask".
> --

ok, just did and it appears to be working; and now that I have a task
the watchVariable started to work too! (that thingy in the other mail
where I tried the dummyTask and it segfaulted, was a silly distraction
of mine, in which, as I copypasted the example, I left the last
argument to scheduleDelayedTask NULL, where I should've passed the
instance of the environment (which is an attribute and not a global);
I guess the long weekend we recently enjoyed here left me somewhat...
"fuzzy"... ;).
I think it may be a good idea to add to the FAQ, in the watchVariable
section, a link to
http://lists.live555.com/pipermail/live-devel/2006-March/004192.html

Well, thanks a lot. See you around,

Juan


More information about the live-devel mailing list