Problem in creating Threads
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums
Results 1 to 8 of 8

Thread: Problem in creating Threads

Threaded View

  1. #1
    Join Date
    Jan 2012

    Problem in creating Threads

    Hi ,

    I am trying to create and test a Thread ..

    Using a code from tutorial ..

    namespace ThreadTry
           class Program
                    static void Main(string[] args)
                    Thread t = new Thread(WriteY); // create thread
                    t.Start(); // start thread
                    for (int i = 0; i < 500; i++) Console.Write('S');
                   for (; ; )
                           // Infinite loop to check thread occurance          
                  static void WriteY()
                              Console.WriteLine("    YYYYYYYY   ");

    I need continuously running thread till my application Runs.
    This is just a test program.
    But the thread t is not continuous. It stops after 1/2 r occurances.

    I am using visual C# express 2010 and unable to use Resume .

    Pl guide me , where is the problem. ?

    Thanking you ..
    Last edited by Arjay; May 3rd, 2013 at 12:59 PM. Reason: Added code tags

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Windows Mobile Development Center

Click Here to Expand Forum to Full Width

This is a survey!

HTML5 Development Center