Your Digital Media Has Never Looked So Good

 
sjb64
Topic Author
Posts: 108
Joined: Thu Apr 16, 2015 1:13 pm
Location: Memphis, TN

Wait vs Sleep

Thu Oct 08, 2015 8:59 am

This is all just experimenting, so am curious about it...

If I create a roVideoScreen page and run my event loop in a tight Port.GetMessage() loop, I can completely disable* HLS playback in the process, I assume by starving the CPU from being able to do anything else. Changing the GetMessage to a Wait makes everything run perfectly. This all seems perfectly sensible to me, and what I would have expected.

But, when I use the Port.GetMessage() loop, and put in a Sleep(1) call in the loop, my expectation would be that everything runs fine, as sleep does its pause "without wasting CPU cycles" per the docs. But the reality seems to be that the CPU is still starved and HLS playback is still completely disabled.

I would have guessed the script blocking done by Wait and the script blocking done by Sleep were similar, but they're it looks like not.

So my question is this - Is Sleep a CPU cycle eating pause (which seems contrary to the docs)?

* By disabled I mean it results in an "Unspecified or invalid track path/url" failure after a bit (on a perfectly good URL that works fine with Wait).
FlixRaider channel
 
EnTerr
** Valued Community Member **
Posts: 3834
Joined: Sun Jan 02, 2011 2:41 am

Re: Wait vs Sleep

Thu Oct 08, 2015 7:18 pm

What device?
I suspect your mileage may vary, 3xxx vs 4xxx vs 5xxx/27xx.
 
sjb64
Topic Author
Posts: 108
Joined: Thu Apr 16, 2015 1:13 pm
Location: Memphis, TN

Re: Wait vs Sleep

Fri Oct 09, 2015 10:14 am

4200X
FlixRaider channel

Who is online

Users browsing this forum: No registered users and 6 guests