LA.NET [EN]

June, 2009Archive

Jun 29

In the previous post, we’ve started looking at memory loads and stores reordering. In this post, we’re going to keep our study and we’re going to introduce atomicity. Atomicity is a really important concept we’ve met in the past. We’ve already talked about it on a higher level: do you recall our discussion on critical […]

Read the rest of this entry »

Jun 29

Multithreading: load and store reordering

Posted in C#, Multithreading       Comments Off on Multithreading: load and store reordering

Until now, we’ve been busy talking a look at several interesting topics associated with multithreading programming. As we’ve seen, one of the most problematic areas in multithreaded programs is sharing state across multiple threads. As we’ve seen in several posts along this series, we can use a critical regions for ensuring that shared state is […]

Read the rest of this entry »

Jun 28

So, I’ve just got a new toy: a wacom Bamboo table. This should be fun after getting a nice free app for drawing :,,) Any thoughts?

Read the rest of this entry »

Jun 27

And that means that I’m 33 years old…damn…

Read the rest of this entry »

Jun 26

And here’s the proof: If you’re interested, you can get more info on the publisher’s site.

Read the rest of this entry »

Jun 25

Multithreading: the BackgroundWorker class

Posted in C#, Multithreading       Comments Off on Multithreading: the BackgroundWorker class

2011-01-12 13:21:55

Read the rest of this entry »

Jun 24

Multithreading: AsyncOperationManager and AsyncOperation helpers

Posted in C#, Multithreading       Comments Off on Multithreading: AsyncOperationManager and AsyncOperation helpers

In the last posts, we’ve taken a look at how synchronization contexts help marshal work across threads. Today we’re going to talk about two classes (which we’ve already met in the past when we implemented the EAP) that abstract even further the use of synchronization contexts: I’m talking about the AsyncOperationManager and AsyncOperation classes. Let’s […]

Read the rest of this entry »

Jun 23

Eric Lippert on C# “top methods”

Posted in C#       Comments Off on Eric Lippert on C# “top methods”

Another interesting post by the great Eric Lippert.

Read the rest of this entry »

Jun 23

In the previous post, we’ve started looking at synchronization contexts. In this post, we’ll take a close look at the widows forms custom synchronization context. Whenever you run a windows form app, you might end up interacting with the WindowsFormsSynchronizationContext. The constructor of this class is responsible for getting a reference to the GUI thread […]

Read the rest of this entry »

Jun 23

In the last post, we’ve seen how to marshal back the results obtained on a secondary thread so that controls are updated on the GUI thread. Today we’re going to start looking at synchronization contexts. Synchronization contexts are abstractions for marshalling between threads. In other words, they abstract those scenarios where you cannot call a […]

Read the rest of this entry »

Jun 22

In the last post, we’ve see that multithreading is almost a necessity in GUIs. We’ve also seen that there are some gotchas associated with it: a control can only be updated from the GUI thread. In practice, this means that we’ll need to marshal back the results to the main thread when they’re ready. In […]

Read the rest of this entry »

Jun 21

Multithreading: why multithreading on GUIs

Posted in C#, Multithreading       Comments Off on Multithreading: why multithreading on GUIs

In the latest posts, we’ve seen how to implement the event based asynchronous (EAP). When we introduced at the main features of the EAP, I’ve said that you should use this pattern when the consumers of your classes are GUIs programmers. Since we’ve already learned lots of things about EAP, now it’s probably a good […]

Read the rest of this entry »

Jun 20

Multithreading: updating the code to support multiple asynchronous executions of one method

Posted in C#, Multithreading       Comments Off on Multithreading: updating the code to support multiple asynchronous executions of one method

In the previous posts, we’ve seen how to implement the asynchronous event based pattern and how to support several features: executing the task asynchronously; support progress notification; support cancellation. Today we’re going to update our initial code to support several simultaneous asynchronous calls of the same method. If you look at that code, you’ll notice […]

Read the rest of this entry »

Jun 20

I know that I’ve said that the next post of the series would be on how to support several asynchronous tasks. However, I was reminded by a friend that I didn’t had any post on how to support the optional progress info feature. So, I decided to take a small detour today and we’ll see […]

Read the rest of this entry »

Jun 18

Today we’re going to improve the code we’ve started writing yesterday: we’re adding canceling support. As you might recall, in our last post we’ve built a simple class which supports a single asynchronous operation at a time. Since we only support one asynchronous operation at a time and we can only start one asynchronous operation […]

Read the rest of this entry »

Jun 17

In the last post of the series, we’ve taken a look at the main features offered by the event based pattern. Today, we’re going to look at how we can implement that pattern. We’re going to start small and we’re going to reuse the IAsyncResult sample for showing how you can implement this pattern. As […]

Read the rest of this entry »

Jun 16

More on the III Exposition of Vintage and Classic cars

Posted in Trivia       Comments Off on More on the III Exposition of Vintage and Classic cars

I’ve uploaded some more pics to the Facebook album. These were taken with the camera, so they don’t have the same quality as the previous ones.

Read the rest of this entry »

Jun 16

Book review: Here comes everybody

Posted in Books       Comments Off on Book review: Here comes everybody

In my latest mini-vacations, I had some free time to update my reading stack. One of the books I read was Clay Shirky’s Here Comes Everybody. After seeing it well referenced in Jeff Atwood’s blog, I’ve bought and saved it for future reading. In this book, Clay Shirky talks about the new opportunities available for […]

Read the rest of this entry »

Jun 16

C#4.0: clearing up some doubts

Posted in C#       Comments Off on C#4.0: clearing up some doubts

After my last post on C# 4.0, I’ve had an interesting exchange of tweets with Thomas Johansen about the usefulness of the code I’ve shown. As Thomas points out, knowing the type means that you should always cast it to that type so that you work with strongly typed verification (ie, compile time checking). In […]

Read the rest of this entry »

Jun 16

In the last posts we’ve looked at several details associated with the use of the APM pattern. Today we’re going to start looking at the second pattern for doing asynchronous work: the event based asynchronous pattern. This pattern was introduced with .NET 2.0 and it targets components that are going to be used in GUIs. […]

Read the rest of this entry »

Jun 15

C# 4.0: Dynamic Lookup

Posted in C#       Comments Off on C# 4.0: Dynamic Lookup

According to the C# futures site , C# 4.0 is all about dynamic programming. In practice, the idea is to ease the burden that the C# programmer must bear when interacting, for instance, with objects from dynamic languages or with COM objects (notice the docs mention other kind of objects, but these types should be […]

Read the rest of this entry »

Jun 15

We’re already in June, so where is Resharper 5.0??? :,,)

Read the rest of this entry »

Jun 15

Today we’re going to wrap up our study of the APM pattern by seeing how we can implement the IAsyncResult interface. For those that can’t remember, here’s the interface API again: public interface IAsyncResult{     object AsyncState { get; }     WaitHandle AsyncWaitHandle { get; }     bool CompletedSynchronously { get; }     bool IsCompleted […]

Read the rest of this entry »

Jun 14

Multithreading: understanding the BeginXXX and EndXXX methods

Posted in C#, Multithreading       Comments Off on Multithreading: understanding the BeginXXX and EndXXX methods

Now that we’ve looked at the available waiting options for the APM pattern, it’s time to start digging on its internals. This post is all about understanding the work of the BeginXXX and EndXXX methods (which isn’t much, as we’ll see). As we’ve seen in previous posts, the BeginXXX method is responsible for kicking off […]

Read the rest of this entry »

Jun 14

Now that my miny-vacations are over, it’s time to start posting again. For the first post, I decided to update my book reading with a short review of Robert Ludlum’s The Bourne Identity. To be honest, I’ve only bought this book because I loved the Bourne trilogy (which I still consider one of the best […]

Read the rest of this entry »

Jun 10

Mini-vacations time

Posted in Trivia       Comments Off on Mini-vacations time

For the 1st time in a long time, we have 2 holydays   on consecutive days and do that, I’ve added a day off in Friday. In practice, it’s time for mini-vacations and this means that this blog might be quiet until the weekend :,,)

Read the rest of this entry »

Jun 10

III Exposition of Vintage and Classic cars

Posted in Trivia       Comments Off on III Exposition of Vintage and Classic cars

Pictures were taken on June 10th 2009.

Read the rest of this entry »

Jun 10

Multithreading: APM and the continuation passing style

Posted in C#, Multithreading       Comments Off on Multithreading: APM and the continuation passing style

In this post, we’ll take a look at the last option we can use for the rendezvous phase of the APM pattern. This last option is based on the continuation passing style principle. In practice, this means that we need to wrap up the work that should be performed after the async task ends in […]

Read the rest of this entry »

Jun 10

Multithreading: the APM pattern and polling for completion

Posted in C#, Multithreading       Comments Off on Multithreading: the APM pattern and polling for completion

In this post we’re going to take a look at how we can use polling to see if an asynchronous task has completed. As we’ve seen, the IAsyncResult instance returned from the BeginXXX method (that started an asynchronous task) has an IsCompleted property that returns true when the task is completed. In practice, this means […]

Read the rest of this entry »