ILoggable

A place to keep my thoughts on programming

 Subscribe

geekblog
[at]
claassen [dot] net

Powered by Blogger

Sunday, June 12, 2005

Invoke vs. BeginInvoke

Been using the DebugLog code a bunch but kept having the occasional lock-up at shutdown. So i went back to the whole Invoke business. Problem is that while Invoke does make sure our update code runs on the proper thread, it is also synchronous, which means that if you are asking the DebugLog worker to Join and it is just then calling Invoke, you've got yourself a deadlock. The thread asking for the Join is now blocked, but it's also the thread responsible for the handling the Invoke. Solution:Should've used BeginInvoke, since it does the call asynchronously, avoiding the the Deadlock issue.

The updated .cs and .resx files are here

As I was typing this, suddenly the room shook as if a truck had hit the house. Turns out there was a 5.6 Earthquake near Anza, CA, about 60 miles away.

2 Comments:

At 6:44 AM, Anonymous Anonymous said...

Have you had time to update your idea with the 1.2.10.0 Log4Net? The code has some deprecated namespaces and property access.

 
At 8:32 AM, Blogger ether said...

I have not. I compiled log4net a couple of years ago and since i never had any problems been keeping the same dll around all this time. I really should get the new version one of these days, and when i do i'll update this, since i still use it frequently

 

Post a Comment

<< Home