Thanks for your advices. now I am checking the program for fixing the bug.<br><br>Once I make a modification to the <b>Makefile.am</b>, I got the proper functionality in expected way. But the problem is that functionality will not happened at always, it changed <b>randomly</b> (<b>some times work properly, some times half work, some time one part is work etc.</b>).<br>
<br>the change i did with the Makefile.am is..<br><br><br><span style="color: rgb(255, 0, 0);">AM_</span>CFLAGS = -O2 -Wall $(DEFS) $(INCS)<br>instead of <br>CFLAGS = -O2 -Wall $(DEFS) $(INCS)<br><br><br>Can any one give reasons for this behavior.....? Why this random behavior, why it is working in unpredictable way...?<br>
<br><br><br><br><br><div class="gmail_quote">On Wed, Apr 23, 2008 at 8:30 PM,  &lt;<a href="mailto:xiphmont@xiph.org">xiphmont@xiph.org</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="Ih2E3d">On Wed, Apr 23, 2008 at 9:34 AM, R. P. Janaka &lt;<a href="mailto:rpjanaka@gmail.com">rpjanaka@gmail.com</a>&gt; wrote:<br>
&gt; In my application there are two threads. One is the theora encoder the other<br>
&gt; is a bandwidth measuring program.<br>
&gt;<br>
&gt; Both of them are working properly when they are separated. (theora is<br>
&gt; obviously working properly, bandwidth measuring component also working<br>
&gt; properly)<br>
&gt;<br>
&gt; So this problem is occurred when both these are joined (encoder is the main<br>
&gt; thread, bandwidth measurer is the child thread)<br>
<br>
</div>This is the basic definition of a &#39;concurrency bug&#39;. &nbsp;Just because<br>
they work seperately doesn&#39;t mean there aren&#39;t substantial bugs that<br>
will pop out when two threads work together. &nbsp;Why do you think this<br>
has anything to do with the Makefile?<br>
<br>
Turning on optimization will often make a buggy program behave<br>
differently because it changes the relative timings between threads.<br>
<div class="Ih2E3d"><br>
&gt; So i think that the problem is with my makefile. Please can anyone help me<br>
&gt; to find the problem<br>
<br>
</div>I would be very surprised if the makefile has anything to do with it.<br>
Designing concurrent programs (threads especially) is perhaps the<br>
single hardest thing in software engineering. &nbsp;Debugging even very<br>
simple multithreaded programs can be maddening because the simple act<br>
of turning on debugging or turning off optimization can drastically<br>
change how a bug behaves.<br>
<br>
I&#39;d love to help, but it would drive me insane....<br>
<br>
Monty<br>
</blockquote></div><br><br clear="all"><br>-- <br>Regards,<br>R. P. Janaka