<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:st1="urn:schemas-microsoft-com:office:smarttags" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<meta name=Generator content="Microsoft Word 11 (filtered medium)">
<!--[if !mso]>
<style>
v\:* {behavior:url(#default#VML);}
o\:* {behavior:url(#default#VML);}
w\:* {behavior:url(#default#VML);}
.shape {behavior:url(#default#VML);}
</style>
<![endif]--><o:SmartTagType
namespaceuri="urn:schemas-microsoft-com:office:smarttags" name="country-region"/>
<o:SmartTagType namespaceuri="urn:schemas-microsoft-com:office:smarttags"
name="place"/>
<!--[if !mso]>
<style>
st1\:*{behavior:url(#default#ieooui) }
</style>
<![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
        {font-family:Wingdings;
        panose-1:5 0 0 0 0 0 0 0 0 0;}
@font-face
        {font-family:Tahoma;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman";}
a:link, span.MsoHyperlink
        {color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;
        text-decoration:underline;}
span.EmailStyle17
        {mso-style-type:personal-reply;
        font-family:Arial;
        color:navy;}
@page Section1
        {size:8.5in 11.0in;
        margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
        {page:Section1;}
-->
</style>
</head>
<body lang=EN-US link=blue vlink=purple>
<div class=Section1>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>The LiveMedia library uses the magical
world of select(), which allows for monitoring multiple file handle descriptors
(or in this case, sockets) to monitor for incoming/outgoing data.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>By blocking on this select() call, an event
loop can process multiple socket handles in a single execution context,
effectively giving the impression of multi-threaded behaviour.<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>LiveMedia has a scheduler that you
registers a function callback with a specific socket handle. A basic pseudo
code would be:<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>loop: <o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>{<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>select(descriptor set) </span></font><font
size=2 color=navy face=Wingdings><span style='font-size:10.0pt;font-family:
Wingdings;color:navy'>à</span></font><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'> Blocking call<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>for each SET file handle
in descriptor set<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'> look up
corresponding function handler.<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'> Invoke handler<o:p></o:p></span></font></p>
<p class=MsoNormal style='margin-left:.5in'><font size=2 color=navy face=Arial><span
style='font-size:10.0pt;font-family:Arial;color:navy'>end for<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>}<o:p></o:p></span></font></p>
<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto'><strong><b><font
size=2 color=navy face=Arial><span style='font-size:10.0pt;font-family:Arial;
color:navy'>Jerry Johns</span></font></b></strong><b><font size=2 color=navy
face=Arial><span style='font-size:10.0pt;font-family:Arial;color:navy;
font-weight:bold'><br>
</span></font></b><em><i><font size=1 color=blue face=Arial><span
style='font-size:7.5pt;font-family:Arial;color:blue'>Design Engineer</span></font></i></em><i><font
size=1 color=blue face=Arial><span style='font-size:7.5pt;font-family:Arial;
color:blue;font-style:italic'><br>
<em><i><font face=Arial><span style='font-family:Arial'>Nuvation Research Corp
- <u1:country-region u2:st="on"><u1:place u2:st="on"><st1:place w:st="on"><st1:country-region
w:st="on">Canada</st1:country-region></st1:place></span></font></i></em><br>
<em><i><font face=Arial><span style='font-family:Arial'></u1:place></u1:country-region>Tel:
(519) 746-2304 ext. 221</span></font></i></em><br>
</span></font></i><font size=1 color=navy face=Arial><span style='font-size:
7.5pt;font-family:Arial;color:navy'><a href="http://www.nuvation.com/"
title="http://www.nuvation.com"><em><i><font face=Arial
title="http://www.nuvation.com"><span title="http://www.nuvation.com"><span
style='font-family:Arial;text-decoration:none'>www.nuvation.com</span></span></font></i></em></a></span></font><o:p></o:p></p>
</div>
<div>
<div class=MsoNormal align=center style='text-align:center'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>
<hr size=2 width="100%" align=center tabindex=-1>
</span></font></div>
<p class=MsoNormal><b><font size=2 face=Tahoma><span style='font-size:10.0pt;
font-family:Tahoma;font-weight:bold'>From:</span></font></b><font size=2
face=Tahoma><span style='font-size:10.0pt;font-family:Tahoma'>
live-devel-bounces@ns.live555.com [mailto:live-devel-bounces@ns.live555.com] <b><span
style='font-weight:bold'>On Behalf Of </span></b>Stas Oskin<br>
<b><span style='font-weight:bold'>Sent:</span></b> Monday, August 24, 2009 3:14
PM<br>
<b><span style='font-weight:bold'>To:</span></b> LIVE555 Streaming Media -
development & use<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Live-devel] multiple
instances of live555 library</span></font><o:p></o:p></p>
</div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><o:p> </o:p></span></font></p>
<div>
<p class=MsoNormal style='margin-bottom:12.0pt'><font size=3
face="Times New Roman"><span style='font-size:12.0pt'>Hi Ross.<o:p></o:p></span></font></p>
<div>
<blockquote style='border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;
margin-left:4.8pt;margin-right:0in'>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>You don't do this. Please everybody, read the FAQ!<br>
<br>
The "LIVE555 Streaming Media" software uses an event loop (a single
thread of control) for concurrency, instead of using multiple threads.<o:p></o:p></span></font></p>
</blockquote>
<div>
<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
Sorry for barging into this thread - an architecture question if I may. I
expirirmented with Live555 several times, and got left with a question - if
Live555 supports only a single event-loop, how it's possible to effectively
process multiple real-time sources?<br>
<br>
I mean, if I get packets from 2 sources, there seems no way to process them
both, but only to launch a separate thread (via callback function perhaps)
which would handle them.<br>
<br>
Regards.<o:p></o:p></span></font></p>
</div>
</div>
</div>
</div>
</body>
</html>