Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Performance / June 2008

Tip: Looking for answers? Try searching our database.

Why does the invocation of a delegate via BeginInvoke() take a whole     second?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ChrisWF - 10 Jun 2008 15:03 GMT
Hello!

I have a GUI-instance recieving an event call via remoting. I know
that those events are handled in a seperate thread, therefore I invoke
them using the forms BeginInvoke() method.

     public void UpdateDisplay(string value)
     {
        if (this._displayBox.InvokeRequired)
           this.BeginInvoke(new
DisplayChangedHandler(this.UpdateDisplay), new object[] { value });
        else
           this._displayBox.Text = value;
     }

(DisplayChangedHandler is simply a delegate with a string parameter.)

Let's come to the point:
I wondered why the GUI ever takes a moment until it's "enabled" again
and changes are done. I looked more closely and found out, that the
invocation of the delegate takes 1 second(an average of 1.009 seconds
to be exact).
It's not that I have a great problem with that - I'd just like to know
the reason of the delay.
I checked if it's caused by other operations following the event, but
there's nothing that would take this "long".

It would be great if someone could brighten me :)

Greetings,
Chris
ChrisWF - 11 Jun 2008 14:36 GMT
> Hello!
>
[quoted text clipped - 27 lines]
> Greetings,
> Chris

Ok.... forget this... I must've been completly blind!
When I tried something earlier I had a Thread.Sleep(1000) there.
I still wonder how I could've overseen this really obvious cause of
delay.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.