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, <<a href="mailto:xiphmont@xiph.org">xiphmont@xiph.org</a>> 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 <<a href="mailto:rpjanaka@gmail.com">rpjanaka@gmail.com</a>> wrote:<br>
> In my application there are two threads. One is the theora encoder the other<br>
> is a bandwidth measuring program.<br>
><br>
> Both of them are working properly when they are separated. (theora is<br>
> obviously working properly, bandwidth measuring component also working<br>
> properly)<br>
><br>
> So this problem is occurred when both these are joined (encoder is the main<br>
> thread, bandwidth measurer is the child thread)<br>
<br>
</div>This is the basic definition of a 'concurrency bug'. Just because<br>
they work seperately doesn't mean there aren't substantial bugs that<br>
will pop out when two threads work together. 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>
> So i think that the problem is with my makefile. Please can anyone help me<br>
> 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. 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'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