My Task should work for a long time (it's like a service), so I need to make it LongRunning .
Task
LongRunning
At the same time, I need to mark it as AttachedToParent to prevent the parent from completing the task before completing my service.
AttachedToParent
How to combine these two possibilities of creating a task?
You can create a task with several creation options: that is.
var task3 = new Task(() => MyLongRunningMethod(), TaskCreationOptions.LongRunning | TaskCreationOptions.PreferFairness); task3.Start();
Source: https://habr.com/ru/post/1482394/More articles:Haskell, how to use Language.Haskell.Interpreter to read a configuration file? - haskellRemove doen't set setter from the list? - c #Quoting through a JSON element in AngularJS - jsonwhy is the type Text.Parsec.Token.natural not the same between Hoogle and what is shown with: t? - typesAngular location service doesn't change path - angularjshttps://translate.googleusercontent.com/translate_c?depth=1&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1482395/strange-behaviour-with-ios-kabpersonmodificationdateproperty-seems-to-update-all-the-time&usg=ALkJrhiIETweJkvBoWxN7jMWVixBzOs1hwGson: can we get the serialized field name in the type adapter? - javaapply function to nested list - rOrientation to Android and screen size - androidNSTokenField selection list displays empty space when scrolling - objective-cAll Articles