Result of task invocation on a grain in Orleans

后端 未结 1 1952
闹比i
闹比i 2021-01-28 18:45

I apologize for the long question. I have been experimenting with Orleans to know about its various properties and these questions are logically under one umbrella.


1条回答
  •  生来不讨喜
    2021-01-28 19:39

    First Part
    No, there is no blocking when a call to a grain is made. This post further clears what happens when a grain call is made.

    Second Part
    While it is correct that grains are single threaded, it is wrong to assume that every grain has its own thread in Orleans. As @Tseng says Orleans uses the async feature of .NET Core. It will process a grain until an async operation happens. Then it returns the thread to the thread-pool. This thread can be used by another grain to process data until the async operation is complete. When its complete, it resumes. its not necessary the same thread (but its the same context). The first grain is blocking the thread giving no chance for the second grain to execute.

    Thanks Tseng and Reuben Bond for making things clear.

    0 讨论(0)
提交回复
热议问题