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

C#

 
GeneralRe: Updating Form's lable from external Class , not working !!! Pin
Martin#7-Mar-07 19:59
Martin#7-Mar-07 19:59 
Questionusing single usercontrol manytimes in one form Pin
pashitech6-Mar-07 5:16
pashitech6-Mar-07 5:16 
AnswerRe: using single usercontrol manytimes in one form Pin
Martin#6-Mar-07 5:28
Martin#6-Mar-07 5:28 
QuestionThreading issue: locking data [modified] Pin
Kelsen6-Mar-07 5:14
Kelsen6-Mar-07 5:14 
AnswerRe: Threading issue: locking data Pin
Leslie Sanford6-Mar-07 5:33
Leslie Sanford6-Mar-07 5:33 
GeneralRe: Threading issue: locking data Pin
Kelsen6-Mar-07 5:47
Kelsen6-Mar-07 5:47 
AnswerRe: Threading issue: locking data Pin
led mike6-Mar-07 6:05
led mike6-Mar-07 6:05 
GeneralRe: Threading issue: locking data Pin
Kelsen6-Mar-07 6:19
Kelsen6-Mar-07 6:19 
led mike wrote:
The threads are NOT "finished" after they are "queued", they are ummmm... queued.


After the foreach completes and finishes waiting the threads should have finished executing. An example I wrote prior to posting this question was:

public class ThreadTest
{
    private static readonly int MAX_THREADS = 5;

    public static void Main()
    {
        ThreadPool.SetMaxThreads(MAX_THREADS, MAX_THREADS);
        for (int i = 0; i < 20; i++)
            ThreadPool.QueueUserWorkItem(new WaitCallback(processThread), (i + 1));
        Thread.Sleep(25000);
        Console.WriteLine("Finished!");
    }

    static void processThread(object obj)
    {
        Console.WriteLine("Thread " + (int)obj + " executing.");
        Thread.Sleep(5000);
    }
}

This is of course assuming the Thread.Sleep(25000) will be long enough for the last 5 threads to execute. In my original post I didn't show my Thread.Sleep() but it was there within my code. I'll better document that to help clear up any confusion.


Kelsen

GeneralRe: Threading issue: locking data Pin
Kelsen6-Mar-07 6:39
Kelsen6-Mar-07 6:39 
QuestionMoving an Icon in a LargeIcon Listview Pin
goldoche6-Mar-07 4:24
goldoche6-Mar-07 4:24 
AnswerRe: Moving an Icon in a LargeIcon Listview Pin
led mike6-Mar-07 5:00
led mike6-Mar-07 5:00 
GeneralRe: Moving an Icon in a LargeIcon Listview Pin
goldoche6-Mar-07 5:52
goldoche6-Mar-07 5:52 
GeneralRe: Moving an Icon in a LargeIcon Listview Pin
led mike6-Mar-07 6:09
led mike6-Mar-07 6:09 
GeneralRe: Moving an Icon in a LargeIcon Listview Pin
goldoche6-Mar-07 6:48
goldoche6-Mar-07 6:48 
QuestionRefreshPropertiesAttribute Pin
mihksoft6-Mar-07 3:30
mihksoft6-Mar-07 3:30 
QuestionHow can i make .. Pin
Ahmed EL Gendy6-Mar-07 3:26
Ahmed EL Gendy6-Mar-07 3:26 
AnswerRe: How can i make .. Pin
Guffa6-Mar-07 3:36
Guffa6-Mar-07 3:36 
AnswerRe: How can i make .. Pin
Ennis Ray Lynch, Jr.6-Mar-07 11:56
Ennis Ray Lynch, Jr.6-Mar-07 11:56 
QuestionWINDOWPLACEMENT structure in .Net Pin
manustone6-Mar-07 3:21
manustone6-Mar-07 3:21 
AnswerRe: WINDOWPLACEMENT structure in .Net Pin
Martin#6-Mar-07 3:38
Martin#6-Mar-07 3:38 
QuestionEditing Datagrid Pin
Member 38935606-Mar-07 3:00
Member 38935606-Mar-07 3:00 
AnswerRe: Editing Datagrid Pin
Vasudevan Deepak Kumar6-Mar-07 9:14
Vasudevan Deepak Kumar6-Mar-07 9:14 
QuestionConvert text retrived from mail body to tiff file Pin
rsgdba6-Mar-07 2:59
rsgdba6-Mar-07 2:59 
AnswerRe: Convert text retrived from mail body to tiff file Pin
m@u6-Mar-07 3:30
m@u6-Mar-07 3:30 
Questionbooks for c# Pin
Bala subramanyam M6-Mar-07 1:52
Bala subramanyam M6-Mar-07 1:52 

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.