tagged [threadpool]

ExecuteRequestHandler of a Cloud service taking too long time (almost 80% of total response time)

ExecuteRequestHandler of a Cloud service taking too long time (almost 80% of total response time) I have a Application (Web API , .NET 4.5) hosted as Azure cloud Service. Vm size large and 4 instances...

StackExchange.Redis.RedisTimeoutException: Timeout awaiting response

StackExchange.Redis.RedisTimeoutException: Timeout awaiting response I have a Redis cluster of 6 instances, 3 master and 3 slaves. My ASP .NET Core application uses it as a cache. Sometimes I get such...

WaitAll for multiple handles on a STA thread is not supported

WaitAll for multiple handles on a STA thread is not supported 1. Why do I get this error message? "WaitAll for multiple handles on a STA thread is not supported." 2. Should I use [MTAThreadAttribute] ...

11 Jul at 13:46

Is ThreadPool worth it in this scenario?

Is ThreadPool worth it in this scenario? I have a thread that I fire off every time the user scans a barcode. Most of the time it is a fairly short running thread. But sometimes it can take a very lon...

Not much difference between ASP.NET Core sync and async controller actions

Not much difference between ASP.NET Core sync and async controller actions I wrote a couple of action methods in a controller to test the difference between and controller actions in ASP.NET core: ```...

Thread.Start() versus ThreadPool.QueueUserWorkItem()

Thread.Start() versus ThreadPool.QueueUserWorkItem() The Microsoft .NET Base Class Library provides several ways to create a thread and start it. Basically the invocation is very similar to every othe...

30 Nov at 06:19

IAsyncResult vs ThreadPool

IAsyncResult vs ThreadPool I've just come across IAsyncResult recently and have played with it for quite some time. What I'm actually wondering is why use IAsyncResult when we have a way better altern...

22 Jan at 09:14

What is the C# equivalent of MsgWaitForMultipleObjects?

What is the C# equivalent of MsgWaitForMultipleObjects? I have a Windows Form with a ListView in Report Mode. For each item in the view, I need to perform a long running operation, the result of which...

23 Feb at 19:20

Detecting/Diagnosing Thread Starvation

Detecting/Diagnosing Thread Starvation I am doing some performance/scalability testing of an IIS application that occasionally seems to slow down to a crawl in production. I'm able to reproduce the sl...

11 Jul at 15:7

How to wait for thread to complete without blocking UI

How to wait for thread to complete without blocking UI I want my program to wait after below line as above method is internally calling thread through StartProcessWithProgress() method . I want that t...

Multiplexing C# 5.0's async over a thread pool -- thread safe?

Multiplexing C# 5.0's async over a thread pool -- thread safe? This may seem a little crazy, but it's an approach I'm considering as part of a larger library, if I can be reasonably certain that it's ...

How does running several tasks asynchronously on UI thread using async/await work?

How does running several tasks asynchronously on UI thread using async/await work? I've read (and used) async/await quite a lot for some time now but I still have one question I can't get an answer to...

Thread pooling in C++11

Thread pooling in C++11 : About C++11: - [C++11: std::thread pooled?](https://stackoverflow.com/questions/12993451/c11-stdthread-pooled)- [Will async(launch::async) in C++11 make thread pools obsolete...

what's the proper way to use a ThreadPool?

what's the proper way to use a ThreadPool? If my understanding of the way the ThreadPool works is correct, one of its purposes is to limit the number of worker threads within a process that can be cre...

25 Jan at 04:11

Right approach for asynchronous TcpListener using async/await

Right approach for asynchronous TcpListener using async/await I have been thinking about what is the right way of set up a TCP server by using asynchronous programming. Usually I would spawn a thread ...

What is the async/await equivalent of a ThreadPool server?

What is the async/await equivalent of a ThreadPool server? I am working on a tcp server that looks something like this using synchronous apis and the thread pool: ``` TcpListener listener; void Serve(...

understanding InvalidAsynchronousStateException occurrences

understanding InvalidAsynchronousStateException occurrences When does InvalidAsynchronousStateException get thrown? I have the following piece of code: > control.InvokeRequired ? control.Invoke(expre...

23 May at 12:34

Async-Await vs ThreadPool vs MultiThreading on High-Performance Sockets (C10k Solutions?)

Async-Await vs ThreadPool vs MultiThreading on High-Performance Sockets (C10k Solutions?) I'm really confused about `async-await`s, `pool`s and `thread`s. The main problem starts with this question: "...

HttpWebRequest giving "The request timed out" in Mono

HttpWebRequest giving "The request timed out" in Mono is there any Mono expert here? When I'm make a request to another server it is throwing an execption with the error "The request timed out" and I ...

If my interface must return Task what is the best way to have a no-operation implementation?

If my interface must return Task what is the best way to have a no-operation implementation? In the code below, due to the interface, the class `LazyBar` must return a task from its method (and for ar...

C# - When to use standard threads, ThreadPool, and TPL in a high-activity server

C# - When to use standard threads, ThreadPool, and TPL in a high-activity server I've been reading a lot about threading lately as I am looking to develop a high-performance, scalable TCP server capab...

13 Mar at 09:39

Clarification on thread pool max threads

Clarification on thread pool max threads I've read [here](http://blogs.msdn.com/b/tmarq/archive/2010/04/14/performing-asynchronous-work-or-tasks-in-asp-net-applications.aspx) that : > In v2.0, 3.5, an...

29 Oct at 22:0

Ensuring task execution order in ThreadPool

Ensuring task execution order in ThreadPool I have been reading about the thread-pool pattern and I can't seem to find the usual solution for the following problem. I sometimes want tasks to be execut...

How to force Task.Factory.StartNew to a background thread?

How to force Task.Factory.StartNew to a background thread? I have seen numerous other questions similar to this but did not find my answer there. My problem was that I was creating threads with the fo...

12 Apr at 15:3

How to log correct context with Threadpool threads using log4net?

How to log correct context with Threadpool threads using log4net? I am trying to find a way to log useful context from a bunch of threads. The problem is that a lot of code is dealt with on Events tha...

7 Apr at 07:13