task-parallel-library
Handling Exceptions in Tasks and Parallel loops. (Threading - TPL)
I want to know if you think this is a good way to handle exceptions thrown by Parallel Loops (Parallel.ForEach and/or Parallel.For) inside Tasks.[详细]
2023-04-09 14:04 分类:问答The difference between Task.Factory.FromAsync and BeginX/EndX?
I have very similar code when using the standard BeginRead and EndRead methods from the TcpClient and using Task.Factory.FromAsync.[详细]
2023-04-09 03:01 分类:问答Thread.Sleep blocking parallel execution of tasks
I\'m calling a worker method that calls to the database that then iterates and yield returns values for parallel processing. To prevent it from hammering the database, I have a Thread.Sleep in there t[详细]
2023-04-08 19:14 分类:问答How to abort specific thread in task parallel library with C#
I have this tricky task I\'ve been trying to achieve for quiet sometime but till now I couldn\'t think of anything to make it work. anyway here is the scenario...[详细]
2023-04-08 02:29 分类:问答Re-throw exception in task (TPL) loses stack trace
I\'ve code that rethrows an exception. When I later read the exception from task.Exception, its stacktrace points to the location where I re-threw the exception (line n and not line m, as I expected[详细]
2023-04-07 18:28 分类:问答Why is a non UI thread able to modify UI control in WinForm & TPL?
I was testing a piece of TPL code I wrote below. The two ManagedThreadId\'s display different numbers. The new task therefore, I am assuming, is running on a non UI thread.[详细]
2023-04-07 01:30 分类:问答How to use php code in tpl file in collabtive in smarty?
I need to use php code in tpl file in smarty. I used {php} echo \"hello\"; {/php} But I need to use a smarty variable in php code.[详细]
2023-04-06 08:56 分类:问答Correct way to create a task with a result already ready
Sometimes I create a method like this Task<int> f() { if (...) return Task.Factory.StartNew(() => 42); // in this case, result already known[详细]
2023-04-06 01:13 分类:问答Send multiple WebRequest in Parallel.For
I want to send multiple WebRequest. I used a Parallel.开发者_StackOverflow社区For loop to do that but the loop runs once and the second time it gives error while getting response.[详细]
2023-04-05 19:20 分类:问答Problems with extracting a method because of parallelism
I would like to extract following code into a new method: ... Parallel.For(0, Environment.ProcessorCount, i =>[详细]
2023-04-05 13:38 分类:问答