<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]-->
<title>Re: [Live-devel] Live 555 multi-thread support</title>
<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:blue;
        text-decoration:underline;}
pre
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.EmailStyle18
        {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=blue>

<div class=Section1>

<p class=MsoNormal><font size=2 color=navy face=Arial><span style='font-size:
10.0pt;font-family:Arial;color:navy'>You don&#8217;t really have to run it
under multiple processes, especially since it works fine under its own thread
(pthread in Linux)<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'>The heart of its implementation revolves
around the select() call involving multiple sockets, so really, it is &#8216;safe&#8217;
as long as no one else uses those sockets/ports, and you don&#8217;t try to run
multiple instances of LiveMedia on multiple threads.<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'>I&#8217;ve successfully used LiveMedia in designs
using this above concept and as long as you lower its thread priority relative
to the other threads in your system, it chugs along just fine </span></font><font
size=2 color=navy face=Wingdings><span style='font-size:10.0pt;font-family:
Wingdings;color:navy'>J</span></font><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=navy face=Arial><span
style='font-size:7.5pt;font-family:Arial;color:navy'>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>
</span></font></i><em><i><font size=1 color=navy face=Arial><span
style='font-size:7.5pt;font-family:Arial;color:navy'>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><i><font
size=1 color=blue face=Arial><span style='font-size:7.5pt;font-family:Arial;
color:blue;font-style:italic'><br>
</span></font></i><em><i><font size=1 color=navy face=Arial><span
style='font-size:7.5pt;font-family:Arial;color:navy'></u1:place></u1:country-region>Tel:
(519) 746-2304 ext. 221</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>
</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 color=navy face=Arial
title="http://www.nuvation.com"><span title="http://www.nuvation.com"><span
style='font-family:Arial;color:navy;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>Ross Finlayson<br>
<b><span style='font-weight:bold'>Sent:</span></b> Sunday, July 05, 2009 5:58
AM<br>
<b><span style='font-weight:bold'>To:</span></b> LIVE555 Streaming Media -
development &amp; use<br>
<b><span style='font-weight:bold'>Subject:</span></b> Re: [Live-devel] Live 555
multi-thread support</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>&nbsp;</o:p></span></font></p>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Hi.<br>
<br>
I read the FAQ but I still not 100% sure about this:<br>
<br>
&quot;<o:p></o:p></span></font></p>

</blockquote>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite cite>

<p class=MsoNormal><i><font size=3 face="Times New Roman"><span
style='font-size:12.0pt;font-style:italic'>Longer answer:</span></font></i>
More than one thread can still use this code, if only one thread runs the
library code proper, and the other thread(s) communicate with the library only
by setting global 'flag' variables. (For one possible use of this technique,
see the answer to <a
href="http://www.live555.com/liveMedia/faq.html#exiting-event-loop">this
question</a>.)<o:p></o:p></p>

</blockquote>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite cite>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Another possible way to access the code from multiple threads is to
have each thread use its own &quot;UsageEnvironment&quot; and
&quot;TaskScheduler&quot; objects, and thus its own event loop. The objects
created by each thread (i.e., using its own &quot;UsageEnvironment&quot;) must
not interact (except via global variables).<o:p></o:p></span></font></p>

</blockquote>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite cite>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>&quot;<br>
<br>
Is there any good guide-lines to run the Live555 (or OpenRTSP example) in
multi-threaded fashion?<o:p></o:p></span></font></p>

</blockquote>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt' type=cite cite>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Or my best bet would be to run separate processes?<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'><o:p>&nbsp;</o:p></span></font></p>

</div>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'>Yes, that's the best way - use multiple processes if you can.<o:p></o:p></span></font></p>

</div>

<pre><font size=2 face="Courier New"><span style='font-size:10.0pt'><x-sigsep>-- <o:p></o:p></span></font></pre>

<div>

<p class=MsoNormal><font size=3 face="Times New Roman"><span style='font-size:
12.0pt'><br>
</x-sigsep>Ross Finlayson<br>
Live Networks, Inc.<br>
http://www.live555.com/<o:p></o:p></span></font></p>

</div>

</div>

</body>

</html>