Tech in the 603, The Granite State Hacker

Locking Resources in C# for Read/Write Concurrency

In a previous project, I became a big fan of System.Threading.ReaderWriterLockSlim.  It was an excellent way to guard a resource against concurrency in a relatively flexible manner.  

C# has a lock(object) {} syntax for simple concurrency locks, but what if you have a resource that can sometimes be used concurrently, and other times, exclusively?

Enter System.Threading.ReaderWriterLockSlim.  This has a few handy methods on it for guarding code on a non-exclusive (Read) and exclusive (Write) mode, with an upgradeable lock, as well, so you don’t have to release a read lock in order to upgrade it.

This source works just as well in .NET as UWP.

I commented the code enough to try to make it so that someone familiar with ReaderWriterLockSlim and using(IDisposable){} would understand the rest, so without further ado…

https://gist.github.com/GraniteStateHacker/e608eecce2cb3dba0dbf4363b00e941f.js

Tech in the 603, The Granite State Hacker

Visual Studio 2015: An Insider’s Review

I apologize I’ve been pretty wrapped up in a little bit of everything, but I wanted to share a piece my colleague, Dave Davis, Architect at BlueMetal Architects wrote for SD Times:

https://www.bluemetal.com/News/Dave-Davis-Published-in-SDTimes

Well worth the read.

Tech in the 603, The Granite State Hacker

The Edge Browser in Windows 10

Today, I was mildly (but pleasantly) surprised when I logged into my laptop and discovered it had updated itself over night to the latest build of the Windows 10 Insider Preview (10158).  I shouldn’t have been surprised, in retrospect… I knew a build was coming, and I left my laptop on overnight…

The first thing I did was run smack into the Edge browser, which is far more polished in this build.  More importantly, this new browser has many features built in… especially Web Notes. 

Web Notes is a feature which, with a touch (or click if you don’t have touch) you can graphically deface (ok, “annotate” or “mark up”) web content.  Even more fun, you can  touch again, and post it to your favorite social media site or even to OneNote.

This one feature really differentiates the browser, in my mind, from just about anything else out there, and makes it much more clear why a replacement for IE is justified.   I’d heard about the feature, but the experience is far cooler than just seeing it. 

Frankly, in the past, I’ve panned Spartan/Edge as nothing more than browser platform fragmentation… a new wedge in the browser market designed to make the browser a harder platform to build viable apps for. After experiencing the WebNotes feature, I find myself wondering if it won’t a)  end Internet Explorer, and b) make the web cool again.

Given the way the Edge browser integrates with OneNote, I also find myself wondering if Edge shouldn’t be considered a part of the Office suite rather than a part of Windows.  That said, I’m aware of the fact that Microsoft has no plans to bring Edge to IOS or Android.

Aside from the myriad of practical content research and sharing applications, I can easily imagine Edge Web Notes being a social media hit, especially.  Who wouldn’t love to draw moustaches on all their friends & family’s profile pictures?

I have not heard if Edge on Windows 10 Mobile will have Web Notes, but I will be fully disappointed if it doesn’t.  It’d definitely make the web more versatile in a mobile form factor.  My Lumia 1520 with build 10149 has Edge on it, but no Web Notes…  yet.  As a colleague of mine points out, Edge is a Universal Platform app, meaning the code should be baked in, even if it’s not exposed in the UI.  I’ll keep ya posted.

Wouldn’t it be cool, also, if MS updated the Apache Cordova platform to incorporate Edge as the web view, thereby enabling annotations in apps that use it?

For what it’s worth, I used Edge to compose & edit this post.  Blogger is definitely much happier with Edge than with IE 11.