You must Sign In to post a response.
  • Category: LINQ

    What is PLINQ? any example


    What is PLINQ?

    any example please..

  • #625261


  • #625491
    PLinq is nothing but parallel linq. In ordinary linq the process will run in one processor but the linq query can be run in parallel threads in multiple processors if your server has many.

    System automatically detects how many cores you have, if you have many cores then it will spin up multiple threads and runs the query parallel, in this way it makes the operation very faster.

    var nums = Enumerable.Range(10, 10000);

    var query = from num in nums.AsParallel()
    where num % 10 == 0
    select num;

    // Process the results as each thread completes
    // and add them to a System.Collections.Concurrent.ConcurrentBag(Of Int)
    // which can safely accept concurrent add operations
    query.ForAll((e) => concurrentBag.Add(Compute(e)));

  • #625525
    Hi Raja,

    (PLINQ) Parallel LINQ is a Parallel Execution of LINQ,Parallel implementation of LINQ to Objects.
    PLINQ uses all threads to execute the query chain and once all threads have finished producing the complete set of output, one thread then proceeds to enumerate the output.

    For more detail please visit below link,i hope it will be helpful for you.


    Muhammad Farooq
    (DNS Mentor)
    Visit My

  • #634985

  • This thread is locked for new responses. Please post your comments and questions as a separate thread.
    If required, refer to the URL of this page in your new post.