task-parallel-library
Passing TransactionScope to tasks created by Parallel.Invoke
I want the TxJobs, which are running in parallel, to create a scope from this parent transaction. How do I make this work?[详细]
2023-04-02 02:37 分类:问答TPL: Background thread completion notification?
I have an MVVM application that processes a large number of images in the background, using the .NET 4.0 Task Parrallel Library. The processing is done on a background thread, which posts its progress[详细]
2023-04-01 20:38 分类:问答How to hit the breakpoint at catch block when working with TPL
As I started understanding thru the TPL. I got stuck over in this code. I have 2 task. Task1 thows ArgumentOutOfRangeException and Task2 throws NullReferenceException.[详细]
2023-04-01 09:30 分类:问答Asynchronous socket reading: the initiating thread must not be exited - what to do?
I have a NetworkStream which I read asynchronously (using async/await) await Task<开发者_如何学C;int>.Factory.FromAsync((cb, state) => stream.BeginRead(buffer, offset, readLen - offset), stre[详细]
2023-03-31 22:18 分类:问答How TPL works in a multicore processor
I am new to parallel programming in C# 4.0. I understand that Parallel Programming and Multithreading are two different things. Now in TPL if I create a task like below:[详细]
2023-03-31 09:46 分类:问答Parallel.ForEach Set MaxDegreeOfParallelism globally
Say I have a situation where I really want to use Parallel.ForEach instead of a regular foreach loop because it\'s much more performant (and way cooler), but having .NET determine the degree of parall[详细]
2023-03-30 21:45 分类:问答Properly creating a Task to poll and dispatch child tasks with cancellation for each
I\'m creating a dispatcher class - which is itself a long running task which can be cancelled at anytime by the user.This Task will poll the database to see if there is any work that needs to be done,[详细]
2023-03-30 16:52 分类:问答How do I create closure around the data acted upon by C# 4.0 tasks?
I\'m encrypting data in chunks.I\'m passing each chunk of data to a Task like yay: private static Task<string> EncryptChunk( byte[] buffer, CryptoEngine c )[详细]
2023-03-30 00:35 分类:问答Is there a way to fix the number of threads tasks will schedule to run on?
Say I create 3 threads, but wish to run 4 Tasks on them. Is there any way开发者_运维问答 to fix the number of threads that tasks will run on? Thanks.When you use Tasks (TPL), you do not create the Thr[详细]
2023-03-29 22:48 分类:问答When is Parallel.Invoke useful?
I\'m just diving into learning about the Parallel class in the 4.0 Framework and am trying to understand when it would be useful. At first after reviewing some of the documentation I tried to execute[详细]
2023-03-29 16:15 分类:问答