Sign in
jaredpar's WebLog
Code, rants and ramblings of a programmer.
Translate This Page
Translate this page
Powered by
Microsoft® Translator
Tags
Active Object
Anonymous Types
API Design
await
BclExtras
Blogging
Books
C#
C++
Closures
CLR
CodeDom
Debugging
Developing
DotNet
EESdk
Evil
Exceptions
Expression Evaluator
Extension Methods
F#
Functional
Futures
FxCop
Generics
Gotcha
Humor
IMetaDataImport
Immutable
ISynchronizeInvoke
Lambda
LINQ
LUA
MEF
Misc
Orcas
Patterns
Performance
PInvoke
PowerShell
Rant
RantPack
Refactoring
Regex
Security
SEH
SynchronizationContext
Talks
Templates
Testing
Threading
Tuple
Type Inference
VB
Visual Studio
VsVim
WinForms
Wow64
Browse by Tags
MSDN Blogs
>
jaredpar's WebLog
>
All Tags
>
threading
Tagged Content List
Blog Post:
A more usable API for a mutable thread safe collection
JaredPar MSFT
In my last post we discussed the problems with designing a safer API for mutable thread safe collections that employ only an internal locking system. The result was an API that was more difficult to mess up, yet pretty much unusable. Lets take a look at this problem and see if we can come up with a usable...
on
16 Feb 2009
Blog Post:
Why are thread safe collections so hard?
JaredPar MSFT
Writing a collection which is mutable, thread safe and usable is an extremely difficult process. At least that’s what you’ve likely been told all through your schooling. But then you get out on the web and see a multitude of thread safe lists, maps and queues. If it’s so hard, why are there so many examples...
on
11 Feb 2009
Blog Post:
Thread Local Storage template
JaredPar MSFT
Thread local storage is another method of synchronization between threads. It is different that most synchronization cases because instead of sharing state between threads it enables developers to have independent, thread specific pieces of data which have a similar or common purpose. The uses of thread...
on
21 Apr 2008
Blog Post:
ActiveObject
JaredPar MSFT
I've been busy lately and neglected my series on Active Objects . It's been a fairly busy time for me both in and out of work. Enough excuses, back to the fun. With the basic PipeSingleReader class, we now have the last piece necessary to create an ActiveObject. This article will focus...
on
30 Mar 2008
Blog Post:
PipeSingleReaderNoLock
JaredPar MSFT
Previously we discussed a multi-thread safe queue like data structure using locks as an internal synchronization mechanism. This time we'll look at a version requiring no locks. In the previous version, locks were used to synchronize access to an underlying queue which stored the data. Removing the...
on
3 Mar 2008
Blog Post:
PipeSingleReader
JaredPar MSFT
Before we can get to building an Active Object implementation, there are some more primitive structures we need to define. Active Objects live on a separate thread where every call is executed in a serialized fashion on that thread. The next primitive will allow us to easily pass messages in the form...
on
2 Mar 2008
Blog Post:
SynchronizationContext and Higher Order Functions
JaredPar MSFT
It's often useful to ensure that actions occur on specific threads, in particular event handlers. Take Windows Forms for instance where all operations on a Control must occur on the thread it was created on. Typically this is not a problem since WinForms respond to events such as Click, Move...
on
24 Feb 2008
Blog Post:
Thread Affinity
JaredPar MSFT
Part of creating a multithreading program is understanding which threads objects live on. Seems simple enough and typically is. However it's nice to insert guarantees to match the design. One type of threading model is for objects or subsets of methods in an object to have an affinity to...
on
22 Feb 2008
Blog Post:
Building a Future which returns no Value
JaredPar MSFT
In addition to Future<T> there is also the concept of Futures that don't return any values. Instead the perform the operation and return. Because there is no additional data to pass between the threads building an Empty Future is fairly straight forward. The biggest decision is how...
on
18 Feb 2008
Blog Post:
Building Future<T>
JaredPar MSFT
The last post dealt with building the base Future class. Now we'll build the child class used to run Func<TResult> 's. The basic implementation is straight forward. The class will run a delegate typed to Func<TResult> in the override of RunCore. The trickiest part...
on
13 Feb 2008
Blog Post:
Building the Base Future
JaredPar MSFT
In the end there are two basic types of Future implementations you can use. Futures which return no values Futures which return a value The rest of the behavior and shape of the Future is the same and screams for a pattern of sorts. I've found the best way to implement this behavior is through...
on
12 Feb 2008
Blog Post:
Push Enumerators
JaredPar MSFT
If you read Jon Skeet's blog you'll notice he's been playing around lately with "push" style enumerators. Push enumerators are the concept of "we'll tell you when we're ready". This is different from IEnumerator<T> which is more of a pull; "ask me if I have more data model". His latest idea is...
on
5 Feb 2008
Blog Post:
The first part of building a Future is ... Waiting
JaredPar MSFT
Future's are a great abstraction for asynchronous programming. One of the items making them so good is the easy manner in which you can declare one and wait for it to finish. The idea is to allow for many futures to be declared with as little overhead as possible. In order to do so you need to define...
on
4 Feb 2008
Blog Post:
Active Objects and Futures
JaredPar MSFT
Herb Sutter gave one of my favorite and inspiring presentations. It is called "The Free Lunch is Over". The original article can be found here . My first encounter though came from his PDC presentation and highly recommend viewing that as well. The part that interested me...
on
28 Jan 2008
Blog Post:
Tuples Part 7: Mutable Tuples
JaredPar MSFT
Part 6 left us with comparable tuples. At this point, the Tuple class is functionally complete. There will be a little more done with the debugability and overall fit into larger projects. But otherwise it is sound. Now the focus shifts to generating mutable tuples. Immutability...
on
23 Jan 2008
Blog Post:
CLR Memory Model
JaredPar MSFT
Internally and externally I see a lot of questions about the .Net Memory Model. I think a lot of the confusion comes from the specs. Mainly that there are really two of them. The first is the ECMA CLI Memory Model (Partition 1, Section 12). This standard introduces a relaxed memory model which, IMHO...
on
17 Jan 2008
Blog Post:
ISynchronizeInvoke ... now
JaredPar MSFT
ISynchronizeInvoke is an interface which allows you to execute a delegate synchronously or asynchronously. The implementer of the interface can control how the delegate is executed. In particular the implementer controls on which thread the delegate is executed. It's common for thread sensitive objects...
on
7 Jan 2008
Blog Post:
Tuples Part 1
JaredPar MSFT
A tuple in computer science can be described as a set of name/value pairs. In some cases it can be described as simply a set of values that are accessible via an index [1]. Previously I discussed how to create a Tuple inside of PowerShell . This series will focus on the use of Tuples in DotNet and how...
on
3 Jan 2008
Blog Post:
Types of Immutability
JaredPar MSFT
By definition, an immutable object in computer science is one that is not able to change. Parallel coding is becoming more necessary as the number of cores in a processor are increasing but not the overall speed. As such immutability is will become more important because it is an important asset of multithreaded...
on
4 Dec 2007
Page 1 of 1 (19 items)