[Live-devel] New feature patch: PollingBasedTaskScheduler

Alex Cichowski alex.cichowski at gmail.com
Tue Nov 18 00:58:37 PST 2008


OK. I have to say this does not seem like a robust solution, but maybe
it could be made to work... However, I also need to repeat the whole
process while there is still data to be read from any socket, since
the RTP handlers only read one packet at a time, and therefore can
start to lag behind if the task scheduler is not called often enough
and this is not dealt with somehow. This is a problem I was actually
seeing in practice.

In my proposed patch this is handled by having the updateImp() return
value indicate whether data was available to be processed. update()
then loops until updateImp() returns false. I am not sure how this
could be achieved with the approach you mention - how can I tell if
SingleStep() processed data or not?

As an aside, in relation to this comment in BasicTaskScheduler, and
the surrounding code...
    // For some unknown reason, select() in Windoze sometimes fails
with WSAEINVAL if
    // it was called with no entries set in "readSet".  If this
happens, ignore it:

I believe that on Win32 it is invalid to call select() with no entries
in readSet in the first place, and that this code should be considered
broken for this reason. For details, see here:
   http://msdn.microsoft.com/en-us/library/ms740141(VS.85).aspx
"Any two of the parameters, readfds, writefds, or exceptfds, can be
given as null. At least one must be non-null, and any non-null
descriptor set must contain at least one handle to a socket."

Alex



On Tue, Nov 18, 2008 at 6:24 PM, Ross Finlayson <finlayson at live555.com> wrote:
>> Please find attached a patch that adds an additional task scheduler
>> named "PollingBasedTaskScheduler" to BasicUsageEnvironment. This
>> scheduler can be used for performing updates in a polling fashion,
>> i.e. without any blocking like BasicTaskScheduler does due to its use
>> of a nonzero timeout when calling select().
>
> You can get the same effect, I think, with the existing "BasicTaskScheduler"
> by adding a periodic task, as outlined here:
>        http://lists.live555.com/pipermail/live-devel/2006-March/004192.html
> --
>
> 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