locked
PLINQ/TPL source RRS feed

  • Question

  • When the LINQ CTP was out (around the orcas timeframe), it was very useful to be be able to look at Sequence.cs for example and look at how the query operators are implemented and understand best practices.
    Are there any plans to open up the source to PLINQ and /or TPL?
    Sunday, June 14, 2009 9:02 PM

Answers

  • Hi abpatel-

    Could you elaborate on which best practices you're interested in understanding from the PLINQ source?  With LINQ, it's possible to implement your own operators, and thus seeing how the built-in ones are implemented is beneficial.  With PLINQ, it's not currently possible to implement your own operators from scratch (though you can compose your own operators out of existing ones); if you do end up implementing an operator from scratch, you'd be doing it in terms of IEnumerable<T>, in which case the execution will execute your operators sequentially.

    That said, we understand that there are benefits (largely around debugging) to be able to peer into the source.  Reference source was released for .NET 3.5 (http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx) and if/when the same thing happens for .NET 4, I'd expect both TPL and PLINQ would be part of that, though I can't make any guarantees.

    In the meantime, you have tools like .NET Reflector and ILDASM at your disposal.

    Thanks.
    Monday, June 15, 2009 2:39 PM
    Moderator

All replies

  • Hi abpatel-

    Could you elaborate on which best practices you're interested in understanding from the PLINQ source?  With LINQ, it's possible to implement your own operators, and thus seeing how the built-in ones are implemented is beneficial.  With PLINQ, it's not currently possible to implement your own operators from scratch (though you can compose your own operators out of existing ones); if you do end up implementing an operator from scratch, you'd be doing it in terms of IEnumerable<T>, in which case the execution will execute your operators sequentially.

    That said, we understand that there are benefits (largely around debugging) to be able to peer into the source.  Reference source was released for .NET 3.5 (http://weblogs.asp.net/scottgu/archive/2007/10/03/releasing-the-source-code-for-the-net-framework-libraries.aspx) and if/when the same thing happens for .NET 4, I'd expect both TPL and PLINQ would be part of that, though I can't make any guarantees.

    In the meantime, you have tools like .NET Reflector and ILDASM at your disposal.

    Thanks.
    Monday, June 15, 2009 2:39 PM
    Moderator
  • Hi Stephen-
    Thx for replying.
    By best practices, I was referring to, if one wanted to write extension methods/operators on ParallelQuery<T>, looking at how some of the PLINQ operators are implemented would be  immensely useful in understanding how to go about writing extension methods and building a domain specific API on top of TPL.

    Reflector as always is a trusty sidekick but if the source is or will be made available, it's always desirable to use that as a reference instead of disassembled code.

    Thanks for your time.
    -A

    Tuesday, June 16, 2009 6:44 AM