thread-pool

Accessing Tomcat Internals from Servlet (or Filter)

I would like to get access to the Tomcat internal data from a servlet (or filter). In particular, I would like to read information about busy threads, from thread pool manager. So, my question is if it is possible at all (I can imagine that it could be blocked for safety reason)? If it's possible, maybe someone could give me any advice w...

C# Threadpooling HttpWebRequests

I've read and looked a quite a few examples for Threadpooling but I just cant seem to understand it they way I need to. What I have manage to get working is not really what I need. It just runs the function in its own thread. public static void Main() { while (true) { try { Thr...

Too Many Threads Exception

I am facing problem in blackberry development. In my application I have to get images from the server, so i have to create a separate connection thread for each image i load from the server..but in doing so i am getting TooManyThreadsException..Any ideas regarding controlling the threads... In blackberry an application can have maximum...

specifying ThreadPoolExecutor problem

Is there any way to create Executor that will have always at least 5 threads, and maximum of 20 threads, and unbounded queue for tasks (meaning no task is rejected) I tried new ThreadPoolExecutor(5, 20, 60L, TimeUnit.SECONDS, queue) with all possibilities that I thought of for queue: new LinkedBlockingQueue() // never runs more than 5 ...

Single or multiple thread pools for Java server?

I am writing a fairly complex Java server application which has a significant background processing portion in addition to the usual request-response processing. Some of the background processing is done in a cron-like fashion using Quartz framework. Other tasks are more of on demand - if a new client connects it creates additional job f...

Does changing the culture of a threadpool thread affect it when it gets returned back to the pool?

If I set the CurrentCulture of a thread pool thread, what happens when the thread finishes execution and gets returned back to the thread pool? Does it get its CurrentCulture reset back to the default (whatever that may mean), or will it retain the culture I have set on it? I'm hoping that the framework resets the thread to a default ...

System.Timers.Timer Elapsed taking 10 times longer to execute than a Button_click

I have a fairly process intensive method that takes a given collection, copies the items(the Item class has its Copy() method properly defined), populates the item with data and returns the populated collection to the class's collection property //populate Collection containing 40 items MyClass.CollectionOfItems = GetPopulatedCollection...

Java email sending queue - fixed number of threads sending as many messages as are available

I'm writing a message processing application (email) that I want to have an outgoing queue. The way I've designed this is having a singleton queue class, ThreadedQueueSender, backed by an Executor Service and a BlockingQueue. Additionally, a thread pool of javax.mail.Transport objects is used to obtain and release connections to the outg...

C# lower thread priority in thread pool

Hello, I have several low-imprtance tasks to be performed when some cpu time is available. I don't want this task to perform if other more import task are running. Ie if a normal/high priority task comes I want the low-importance task to pause until the importance task is done. There is a pretty big number of low importance task to be ...

Tomcat thread pool usage schema

I'm developing servlet filter intended to manage some resources which should be available during servlet processing. Since I'm not very familiar with the Tomcat, I have some doubt. Is it guaranteed that, for single request, all attached filters and the servlet itself are processed by single (and the same) thread? In other words: can I as...

Limiting number of requests to a servlet

Hi, We have a servlet which occupies more virtual memory on the server due to the logic it has. For this reason, we would like to limit the concurrent requests to this server say for example we would only want 10 concurrent requests processed. The other requests have to wait in the queue. Can a custom thread pool be created and assign ...

Request for SERVER prgm using THREADPOOL ,such that it accepts several clients and responding them with their respective response files

Hi Everyone, can i have code of serverprogram which accepts several client connections using THREADPOOL concept,where each client send a file to server and server should respond to them with respective response file......i am asking like this because i am able to get several client request but i am not able to reply them back with the re...

How is the thread-pool handled when using System.Timer objects in multiple threads?

Ok, I know an object of System.Timer executed in the thread-pool, rather than in the UI thread. I also know that the System.Timer is thread-safe. Say I have a collection of System.Timer objects. I can have all of them run and (unless i'm mistaken) they'll actually execute in the thread-pool. Say I instead create a collection of thre...

jetty configuration: what is "lowThreads"?

I'm writing a jetty configuration file, and I haven't been able to find information about a thread pooling parameter. My aim is to tune jetty for performance, and I would like to understand what the "lowThreads" item means for a ThreadPool object. Up to now, I've found that it's used to "set the low resource threads threshold", and tha...

Java Thread Pool

I want to learn to write a thread pool in Java Can anyone point me to useful resources ? ...

.NET Thread Pool - Unresponsive WinForms UI

Scenario I have a Windows Forms Application. Inside the main form there is a loop that iterates around 3000 times, Creating a new instance of a class on a new thread to perform some calculations. Bearing in mind that this setup uses a Thread Pool, the UI does stay responsive when there are only around 100 iterations of this loop (100 As...

Recursively adding threads to a Java thread pool

I am working on a tutorial for my Java concurrency course. The objective is to use thread pools to compute prime numbers in parallel. The design is based on the Sieve of Eratosthenes. It has an array of n bools, where n is the largest integer you are checking, and each element in the array represents one integer. True is prime, false is...

Help regarding C# thread pool

I have a method that gets called quite often, with text coming in as a parameter.. I'm looking at creating a thread pool that checks the line of text, and performs actions based on that.. Can someone help me out with the basics behind creating the thread pool and firing off new threads please? This is so damn confusing.. ...

Minimizing Java Thread Context Switching Overhead

I have a Java application running on Sun 1.6 32-bit VM/Solaris 10 (x86)/Nahelem 8-core(2 threads per core). A specific usecase in the application is to respond to some external message. In my performance test environment, when I prepare and send the response in the same thread that receives the external input, I get about 50 us advanta...

java thread pool keep running

This is more a generic question than a specific one. I'm trying to have a multi threaded environment that stays active so that I can just submit tasks and run them. I want to do this without the hassle of executing in a web server or application server. The idea was to use a java thread pool for this, but the issue here is that the pool ...