multithreading

Servlets, filters and threads in Tomcat

Hello, In the Tomcat container, do all the filters associated to a servlet and the servlet itself use the same thread? i.e, will doFilter() be run in the same thread as a servlet's service() method? Thanks in advance. ...

Online Tutorial on I\O completion ports

Are there any good online tutorials on I/O completion ports. I found few of them but they were very highlevel and could not really understand. ...

what type of design diagram for a multiple thread based application?

What type of design diagram is recommended for capturing the high level/concept design of an application that has multiple threads? Any examples? In my specific case (C# WPF app) I have a application that has: a UI project & some class libraries (util classes broken out for reuse) classes within (both UI and class library) but also ...

Update and delete entities in two different process

Hi everybody, I'm working on an ipad application that use coredata. It download information on a database that is on the web, and record them in coredata. The application is based on a split view. My problem was to make the update of the data in background. Here is how I've done : - I've create an NSOperation, that does the download and ...

4 threads as services in Android

I want to implement 4 threads as services in android. How di i do that. Can anyone suggest a good example for the same.? ...

InterruptedException from Thread.sleep()

In Java, Thread.sleep() throws InterruptedException. What is the proper thing to do with this exception? propagate the exception as a failure up the call chain eat the exception and proceed with your code other ...

WPF: Trouble controlling a button's enabled/disabled state using Command binding and a thread

I have a WPF app that simply contains a Button and a Textbox to display some output. When the user clicks the Button, a thread starts which disables the Button, prints stuff to the output Textbox, then the thread stops (at which point I want the Button to be enabled again). The application appears to disable the Button properly, as wel...

Java GC Threading Bottleneck in Practice?

How well optimized is Java's parallel collecting GC for multithreaded environments? I've written some multithreaded Jython code that spends most of its time calling Java libraries. Depending on which options I run the program with, the library calls either do tons of allocations under the hood or virtually none. When I use the options...

How do i get ruby to output an exception inside a thread?

When I spawn a thread with Thread.new{} it looks like any exception that happens in that thread never sees the light of day, and the app just quietly ignores it ...

c# BeginInvoke Problem

I have a program that makes some hefty calls to the database and then updates the UI. This is causing problems because for most of the time it means that the UI in not responsive. I therefore decided that I wanted to put the function calls that access the database and update the UI in a separate thread, so now I have something like thi...

Servlets should not start threads due to issues that may arise when clustering ....what issues ?

I know that we should not start threads in a servlet is that threads should be managed by the container. If the container is told to shutdown if there are threads that it does not know about hanging around it wont shutdown. I take care of this by making it a daemon thread... But other than the above "unable to shutdown" situation what o...

android set visibility of a button on timer

Hi, I have an app that shows a disclaimer at the beginning of the program. I want a button to remain invisible for a set amount of time, and then become visible. I set up a thread that sleeps for 5 seconds, and then tries to make the button visible. However ,I get this error when I execute my code: 08-02 21:34:07.868: ERROR/AndroidRunti...

Thread class memory allocation oddity on an embedded platform

I am running into a strange issue I've been able to track down somewhat but I still can't see the cause. Maybe someone here can shed some light? I'm running on a PowerPC processor on top of VxWorks 5.5 developing in C++ with the PPCgnu604 toolchain. I have a class like so: class MyClass { public: void run( void ); private: ...

Separating OpenGL Calls from Updating on the iPhone

I'm a bit of a newb when it comes to threading, so any pointers in the right direction would be a great help. I've got a game with both a fairly heavy update function, and a fairly heavy draw function. I'd assume that the majority of the weight in the draw function is going to happen on the GPU. Because of this, I'd like to start calcula...

Run certain code every n seconds

Is there a way to, for example, print Hello World! every n seconds? For example, the program would go through whatever code I had, then once it had been 5 seconds (with time.sleep()) it would execute that code. I would be using this to update a file though, not print Hello World. For example: startrepeat('print('Hello World'), .01) #re...

How not to wait for other threads in OpenMP?

Hi I am considering using OpenMP for multithreading in C++. But I wonder if there is a way tell a thread not to wait for other concurrent thread and continue with my program? (Maybe I can cancel/kill other threads?) I am aware of the existence of "nowait" clause, but I want the decision of "wait" or "not to wait" to be done dynamically...

Fastest way to asynchronously execute a method?

hi there, i´m currently dealing with a problem where i have to dispatch hell a lot of functions to another thread to prevent the current function from blocking. now i wonder what the fastest way is to perform this task. currently i´m stuck with ThreadPool.UnsafeQueueUserWorkItem as its slightly faster than the regular QueueUserWorkI...

Threads and Jms Transaction

I am stuck in the following scenario.Please advice me on this There is an inbound Queue There is an Main thread running(We are not using JMS Listener ) and picking a message from the queue and process the message and start another sub thread to process again. Now the problem is How can i handle the transaction in the main thread and su...

TOO MANY THREADS ERROR EXCEPTION

Hi, i am facing a problem while making an application of Blackberry that i have upto 7 threds call, of which each downloads an audio from the Server and it works fine but when i start my application twice then an uncaught exception has been occurred that "TOO MANY THREADS ERROR EXCEPTION", So, let me know that how i can solve this proble...

Why ThreadPool has 250 worker threads per processor by default?

Taken from Microsoft documentation: By default, the thread pool has 250 worker threads per available processor. You can change this setting using the ThreadPool.SetMaxThreads method. It's also said, as it's widely known, that there is some overhead: Threads have some level of overhead. Therefore, if a computer has multiple pr...