Click here to Skip to main content
15,897,371 members
Home / Discussions / C#
   

C#

 
AnswerRe: Calling a method from a form in another form Pin
motojojo21-Feb-07 3:56
motojojo21-Feb-07 3:56 
QuestionAdd attribute to the http header of a request Pin
blackjack215020-Feb-07 23:55
blackjack215020-Feb-07 23:55 
AnswerRe: Add attribute to the http header of a request Pin
B.A21-Feb-07 1:30
B.A21-Feb-07 1:30 
Questionproblem in login page Pin
vijayashanthi20-Feb-07 23:43
vijayashanthi20-Feb-07 23:43 
AnswerRe: problem in login page Pin
Colin Angus Mackay21-Feb-07 0:47
Colin Angus Mackay21-Feb-07 0:47 
Questionhow can encrypt a film Pin
B.A20-Feb-07 23:39
B.A20-Feb-07 23:39 
AnswerRe: how can encrypt a film Pin
Mark T.21-Feb-07 2:24
Mark T.21-Feb-07 2:24 
QuestionStopping a Thread Pin
nasambur20-Feb-07 23:22
nasambur20-Feb-07 23:22 
Hi,

I'm writing a LoadGenerator application, in which for a specific period of time
certain no.of Threads are created and executes simultaneously..
That i call as RampUp threads.

After sleeping for a sustain period (10secs) of time.. I want to RampDown threads, that is i want to kill the threads one by one..

I have defined an ArrayList object alThreads to maintain the Threads list..

RampUp() method

public void RampUp()
{
  for(int i=0; i<10; i++)
  {
    Thread thread = new Thread(ExecuteSingleThread);
    thread.Start();
    if(alThread.Contains(thread) == false)
    {
      alThreads.Add(thread);
    }
    Thread.Sleep(5000);
  }
}


The below code kills the thread every five second..

RampDown() method

public void RampDown()
{
for(int i=0;i<alThread.Count;i++)
  {
    Thread thread = (Thread)alThreads[i];
    if(thread.IsAlive)
      thread.Abort();
    Thread.Sleep(5000);
  }
}


Now the problem is after killing the first thread, all the remaining threads
doesn't executes the code inside it..

Please help me..

regards,
nas
AnswerRe: Stopping a Thread Pin
nikneem200520-Feb-07 23:41
nikneem200520-Feb-07 23:41 
GeneralRe: Stopping a Thread Pin
nasambur21-Feb-07 0:48
nasambur21-Feb-07 0:48 
QuestionobjCompilerResults.Errors.Count Pin
nasambur20-Feb-07 23:18
nasambur20-Feb-07 23:18 
QuestionCompiler [modified] Pin
hiremath7120-Feb-07 22:59
hiremath7120-Feb-07 22:59 
QuestionCrystal Report Licence Pin
Banjo Ayorinde20-Feb-07 22:25
Banjo Ayorinde20-Feb-07 22:25 
QuestionAdding Items to combo box from a table field Pin
Banjo Ayorinde20-Feb-07 22:17
Banjo Ayorinde20-Feb-07 22:17 
AnswerRe: Adding Items to combo box from a table field Pin
Christian Graus20-Feb-07 23:09
protectorChristian Graus20-Feb-07 23:09 
AnswerRe: Adding Items to combo box from a table field Pin
Niiiissssshhhhhuuuuu20-Feb-07 23:12
Niiiissssshhhhhuuuuu20-Feb-07 23:12 
Questionhow can i send just one byte with serial port? Pin
Mir_As20-Feb-07 22:15
Mir_As20-Feb-07 22:15 
AnswerRe: how can i send just one byte with serial port? Pin
stancrm20-Feb-07 22:36
stancrm20-Feb-07 22:36 
QuestionLoading Report (Crystal Report) from my Application, after deployment. Pin
Banjo Ayorinde20-Feb-07 22:11
Banjo Ayorinde20-Feb-07 22:11 
QuestionProblem in loading form Urgent please Pin
NK720-Feb-07 20:47
NK720-Feb-07 20:47 
AnswerRe: Problem in loading form Urgent please Pin
NK720-Feb-07 20:48
NK720-Feb-07 20:48 
AnswerRe: Problem in loading form Urgent please Pin
PandemoniumPasha20-Feb-07 22:11
PandemoniumPasha20-Feb-07 22:11 
GeneralRe: Problem in loading form Urgent please Pin
NK720-Feb-07 22:25
NK720-Feb-07 22:25 
GeneralRe: Problem in loading form Urgent please Pin
NK720-Feb-07 22:41
NK720-Feb-07 22:41 
QuestionHow to retrieve list of users from particular Active Directory Group Pin
prabhakaranns20-Feb-07 20:40
prabhakaranns20-Feb-07 20:40 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.