none
TaskScheduler local queues – LIFO order of processing RRS feed

  • Question

  • In accordance to MSDN documentation (https://msdn.microsoft.com/en-us/library/system.threading.tasks.taskscheduler.aspx – The global queue vs. local queues) “The local queues are accessed in last-in, first-out order (LIFO) to preserve cache locality and reduce contention.”.

    I could not imagine how the LIFO order could involve this behaviour and also I do not know what is exactly cache locality, particularly what cache is used.


    • Edited by User919 Friday, April 7, 2017 8:14 AM
    Friday, April 7, 2017 8:11 AM

Answers

  • Hi User919,

    >>I could not imagine how the LIFO order could involve this behaviour and also I do not know what is exactly cache locality, particularly what cache is used.

    As far as I know, the key to cache locality (multithreaded) is Keep work units in a contiguous block of RAM that will fit into the cache

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 10, 2017 6:12 AM
    Moderator

All replies

  • Hi User919,

    >>I could not imagine how the LIFO order could involve this behaviour and also I do not know what is exactly cache locality, particularly what cache is used.

    As far as I know, the key to cache locality (multithreaded) is Keep work units in a contiguous block of RAM that will fit into the cache

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 10, 2017 6:12 AM
    Moderator
  • Hi User919,

    >>I could not imagine how the LIFO order could involve this behaviour and also I do not know what is exactly cache locality, particularly what cache is used.

    As far as I know, the key to cache locality (multithreaded) is Keep work units in a contiguous block of RAM that will fit into the cache

    Best regards,

    Cole Wu


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Hi,

    thank you for explanation of cache locality. I understand this part.

    U.

    Saturday, December 16, 2017 4:47 PM