lamp

Browse by Tags

Sorry, but there are no more tags available to filter with.
Locking mechanism: Monitor
21 May 09 10:36 PM | Frederick.Chapleau | with no comments
Comparing to way of locking.. lock( object ){ } and Monitor.Enter() and Monitor.Exit(). It is the same! But the better way to do it, is to use the lock statement, because you can always forget to Monitor.Exit() or an error can throw an exception before...
Filed under:
Volatile C# modifier
10 May 09 05:54 PM | Frederick.Chapleau | with no comments
The volatile C# modifier is used to declare a field that can be accessed by multiple thread. It indicates to the compiler optimizer that the code should not be optimize for single thread development. The usage of the volatile keyword is required to safely...
Filed under:
A fast way to invoke a method
04 May 09 10:36 PM | Frederick.Chapleau | with no comments
In .NET 1.1, when you wanted to call a method by invoking it, you had to create a delegate representating the method’s signature, and invoke it. Now, with .NET 2.0, a MethodInvoker was created to call directly the method. (new MethodInvoker(delegate(...
Filed under:
Invoking when multi-threading
25 April 09 01:15 PM | Frederick.Chapleau | with no comments
Multi-threading is the new way to develop, if you want to fully use the computer power. But (there is always a but), if you want to safely update the UI, you must invoke the method, instead of just calling it, when you are not on the Form’s thread. There...
Filed under: