jaredpar's WebLog

Code, rants and ramblings of a programmer.
Posts
  • jaredpar's WebLog

    Dealing with Exceptions in a Future

    • 7 Comments
    Besides waiting, the another important issue when dealing with Futures is how to deal with exceptions thrown by the user specified code.  Option 1: Ignore the Exception Don't take any actions in the future code and force users to write exception...
  • jaredpar's WebLog

    Building the Base Future

    • 5 Comments
    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...
  • jaredpar's WebLog

    Building Future<T>

    • 4 Comments
    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...
  • jaredpar's WebLog

    The first part of building a Future is ... Waiting

    • 2 Comments
    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...
  • jaredpar's WebLog

    Push Enumerators

    • 1 Comments
    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...
  • jaredpar's WebLog

    Thread Affinity

    • 1 Comments
    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...
  • jaredpar's WebLog

    Factory Methods for Futures

    • 1 Comments
    Like most generic classes, I prefer to create Future instances through static factory methods which allows me to take maximum advantage of type inference. In addition to the 2 straight forward declaration of Func<T> and Action, the methods will...
  • jaredpar's WebLog

    SynchronizationContext and Higher Order Functions

    • 1 Comments
    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...
  • jaredpar's WebLog

    Building a Future which returns no Value

    • 1 Comments
    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...
  • jaredpar's WebLog

    Get-Content and File Names

    • 1 Comments
    Another day, another PowerShell feature discovered.  Unfortunately this time it was a feature that made me think I had a bug in my script.  The script read through some directories, did some file parsing and created a data object for every directory...
  • jaredpar's WebLog

    Multiple paths to IUnknown

    • 0 Comments
    ATL has a lot of great tools for COM programming and CComPtr is a good example. It's a smart pointer class which manages the reference count of an underlying COM object. One of it's limitations though is it will only work properly when the inheritance...
Page 1 of 1 (11 items)

February, 2008