Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have a problem using Thread in my application. The application is getting hanged because of using a thread.if anyone have the solution please give me. Thanks in advance.


//This is declared Globally
 Thread TrdCopyFLV=new TrdCopyFLV();

//this is called in a timer
if (TrdCopyFLV == null || !TrdCopyFLV.IsAlive)
                   {
                       //TrdCopyFLV = new Thread(delegate() { ConvertToFlv(lOpr1, lOpr2); });
                       TrdCopyFLV = new Thread(ThreadConvertToFlv);
                       TrdCopyFLV.IsBackground = true;
                       TrdCopyFLV.Priority = ThreadPriority.Lowest;
                       TrdCopyFLV.Start();
                   }
Posted
Updated 20-Jun-13 19:26pm
v2

1 solution

As per your code, I understood there are multiple Threads are executing in every timer tick. I think that causing problem. Try to fix the problem. Threads never hags yours application, if you handle it in proper way.
--RA
 
Share this answer
 
Comments
rebounderarun 21-Jun-13 1:37am    
Thanks Rajesh, iam not good in thread i want to know how to call a thread continuously.
Shall i want to put join or else abort.please tell me or post any example Thanks.
Rajesh Anuhya 21-Jun-13 1:41am    
Declare your thread object globally,
declare this "Thread TrdCopyFLV=new TrdCopyFLV()" as global, and try
--RA

rebounderarun 21-Jun-13 2:06am    
ok i will check Thanks.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900