xzenon's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
15 (0.01 per day)
Joined:
25-September 10
Profile Views:
481
Last Active:
User is offline Oct 06 2012 10:10 PM
Currently:
Offline

Previous Fields

Dream Kudos:
0
Icon   xzenon has not set their status

Posts I've Made

  1. In Topic: cross thread call

    Posted 6 Oct 2012

    View PostNathanMullenax, on 06 October 2012 - 12:51 PM, said:

    Also: I'm not disagreeing with tlhIn`toq here. The UI should be managed by a single thread. However, the UI thread shouldn't be handling all of the non-UI work a program does. I can think of reasonable scenarios where you would do something like this:

    // launch a background thread to raytrace
    // the NYC skyline
    void render()
    {
        Thread th = new Thread(doSomethingSlow);
        th.IsBackground = true;
        th.Start();
    }
    
    void doSomethingSlow()
    {
        // really slow stuff
        // queue an event to update a picture box.
    }
    
    


    The doSomethingSlow method isn't a UI thread, but it needs to notify the UI when it is done its work--and that's all its doing. It might need to re-enable a disabled button, or let the user know that a large file is done loading and is ready to work with. Using the pattern I mentioned, it's sending a message to the appropriate HWND, which is then handled by the UI thread when it is reached in the queue.


    Tnx man worked like a charm

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:

Contact Information

E-mail:
Private

Friends

xzenon hasn't added any friends yet.

Comments

xzenon has no profile comments yet. Why not say hello?