[Live-devel] Performance imporved -- SingleStep improved

Ross Finlayson finlayson at live555.com
Thu Jul 28 20:37:56 PDT 2011


On Jul 28, 2011, at 10:19 PM, xue wrote:

> /* Here should process the queue data before get new frame from source, this very important for IP net work camera, the video latency will 50ms shorter than before. Zack */
> if (tv_timeToDelay.tv_sec == 0 && tv_timeToDelay.tv_usec == 0){
>          fDelayQueue.handleAlarm();
>          return ;
> }

I don't understand how this could make any difference, because - within the event loop - "SingleStep()" is called over and over again.  Therefore, in the current code, the event loop consists of
	select()
	socket handler (if any)
	delay queue handler (if any)
	select()
	socket handler (if any)
	delay queue handler (if any)
	select()
	socket handler (if any)
	delay queue handler (if any)
	select()
	socket handler (if any)
	delay queue handler (if any)
	…

Your proposed change merely changes this to:
	delay queue handler (if any)
	select()
	socket handler (if any)
	delay queue handler (if any)
	delay queue handler (if any)
	select()
	socket handler (if any)
	delay queue handler (if any)
	delay queue handler (if any)
	select()
	socket handler (if any)
	delay queue handler (if any)
	delay queue handler (if any)
	select()
	socket handler (if any)
	delay queue handler (if any)
	…

Calling up to two delay queue handlers for each call to "select()" shouldn't make a difference (except perhaps in weird circumstances).

In any case:
1/ Your proposed code change is wrong, because of the possibility that your new delay queue handler will cause "fReadSet" to be modified.  (Note the comment at the end of the "SingleStep()" code.
2/ As I noted in my previous message, you are welcome (of course) to make this change in your own code, but if you do, you should change the name of the class, so that it doesn't clash with the name "BasicTaskScheduler" used by the released code.

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.live555.com/pipermail/live-devel/attachments/20110728/060a7afe/attachment-0001.html>


More information about the live-devel mailing list