Two More Ways for Diagnosing For Which Synchronization Object Your Thread Is Waiting

April 24, 2013

It is as though there is an infinite variety of heuristics that you can use to determine which synchronization object your thread is waiting for. In fact, these are heuristics for retrieving fastcall parameters passed in registers that have been clobbered by subsequent method calls. Method 1: Inspect the handle passed to WaitForMultipleObjectsEx The CLR uses an auto-reset event to implement sync block synchronization, which means that every attempt to acquire an owned sync block will result in a call to WaitForMultipleObjectsEx. If you inspect this method's parameters, you'll find a handle that you might be able to correlate with the...
3 comments

Revisiting Value Types vs. Reference Types

April 10, 2013

Why do C#, the .NET Framework, and the CLR need value types and reference types? Why two categories of types? Why the added complexity in training developers to understand why and when to use each type of type? There are many answers, but very few get to the crux of the matter. You could try to justify the need for two types of types by looking at the semantic differences C# affords each. For example, you know that by default, instances of value types are copied when passed to a function, but instances of reference types are not -- only...
2 comments

Windows Azure Mobile Services "Rent a Home" Sample, Part 3: Authentication

April 8, 2013

Last time around, we explored the user interface and the server script for our apartment listings application. Today we'll see how to add authentication to the mix, and limit certain operations only to authenticated users. This is particularly important in the Rent a Home application, because you don't want anonymous users deleting and updating apartment listings! In fact, you'd probably want only the user that created an apartment listing to have the right to update or delete it. NOTE: Windows Azure Mobile Services is configured by default to enable any user with the application URL and application key to perform...