Link to home
Start Free TrialLog in
Avatar of enrique_aeo
enrique_aeo

asked on

problem with Thread


    private void ExecuteWithThread()
    {
        List<Thread> threads = new List<Thread>(30);
        for (int idx = 0; idx != 30; ++idx)
        {
            threads.Add(new Thread(new ParameterizedThreadStart(RunThread)));
        }
        for (int idx = 0; idx != 30; ++idx)
        {
            threads[idx].Start(idx + 1);
        }
        foreach (Thread thread in threads)
        {
            thread.Join();//Bloquea el subproceso de llamada hasta que termina un subproceso
        }
    }

    private void RunThread(object param)
    {
       
        int threadNo = int.Parse(param.ToString());
        CallPageLoad();
      }

     protected void Page_Load(object sender, EventArgs e)
    {
        ExecuteWithThread();
      }
      
 
      protected void CallPageLoad()
    {
        try
        {
        .
        .
            .
            }
      
      
I have a web application. i use Thread for call the method protected void Page_Load(object sender, EventArgs e)
the error is:
SurveyWrapper1.ReturnFromMemory(VoxivaConstants.JOB_ID)      The type 'SurveyWrapper1' exists in both 'App_Web_xq8kezzn.dll' and 'App_Web_i3jzrl6a.dll'
then ex = {"Object reference not set to an instance of an object."}
where public class SurveyWrapper1      
ASKER CERTIFIED SOLUTION
Avatar of eitama
eitama

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial