Bloqueado linq contention time

  • segunda-feira, 24 de outubro de 2011 14:31
     
     
    I'm trying to write linq in a parallel context:
    Parallel.For(0, 4, op, Sub(iOppInfo, loopState)
                                       Dim r = (From a In listA
                                              Join b In listB
                                               On a.A_FieldA Equals b.B_FieldA
                                              Join c In listC On b.B_FieldB Equals c.C_FieldB
                                       Where (a.A_FieldD.Length < 5)
                                              Select a)
                                       Dim list As New List(Of ClassA)
                                       For Each e In r
                                           list.Add(e)
                                       Next
    I run a profiling analyzing and found at blocked time at:
    -System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
    --ConsoleApplication3.Module1._Lambda$__7(class VB$AnonymousType_0`2<class ConsoleApplication3.Module1/ClassA,class ConsoleApplication3.Module1/ClassB>,class ConsoleApplication3.Module1/ClassC)
    ---JIT_NewFast(struct CORINFO_CLASS_STRUCT_ *)
     (listA,listB,listC won't be changed during the operation (you can consider it as readonly))
    Question: Is it normal? How can I make it not blocked? 
    Making listA,listB,listC static?

Todas as Respostas

  • quinta-feira, 27 de outubro de 2011 18:28
    Moderador
     
     

    Can you provide your project?

    This forum is for discussing the tool's usage, instead of improve the performance and algorithm, so it would be off-topic in this forum, can I help you change the thread type to keep this thread here, or I need to move it to off-topic forum, if I have not misunderstood your question.

    If there's any concern, please feel free to let  me know.

    Best wishes,


    Mike [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

  • domingo, 30 de outubro de 2011 12:25
    Moderador
     
     
    I am writing to check the status of the issue on your side. 
    What about this problem now? 
    Would you mind letting us know the result of the suggestions?

    Mike Zhang[MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.