multithreading

ASP.NET MVC application running II6 with wildcard mapping using only 3 threads

During the performance testing of our ASP.NET MVC application I discovered interesting bottle neck. The application is using only 3 managed threads. I checked maximum thread pool size. It's 200 and we are having 197 available threads. I checked connection limit of web site and it's unlimited. I tried to run stress test locally agains...

Order of execution of waiting threads blocked by mutex

I have a mutex that controls access to a single object from multiple threads. When a thread has finished the mutex is unlocked to allow order threads to operate on the object. On Windows using the WaitForSingleObject function is there an order that threads are signaled? I want the first thread that attempts to lock the mutex to now be al...

multithreading in c# compact framework

hi all; i am using compact frame work for my windows mobile application in which i have pass more than one request to the server and receive response for each request in an array. the problem is there when i should access these arrays because i m starting the threads in a for loop and the after completing the loop i have to access thes...

Using extended Swing component, threading doubt

I have built my own component extending JPanel. I've added a few methods like calculateWhatever()... Should I call those methods with invokeLater() as well? Substance L&F is not complaining about it but I'm having rare random painting problems and I'm wondering If they're happening because of those calculations inside the extended swing...

Debugging C# Threads

I am aware whether the same question has already been asked (if so please let me know).When i am working on multithreads how can i debug to know which thread causes an abnormal behavior ? could i need to use permonitor for debugging or any other tool or debugging facilities are available ? Thanks. ...

Handling Parameters in Threads

I am just a beginner."ParameterizedThreadStart" accepts single object as argument. Is there any other delegate signature allows me to (1) pass params (variable number of parameter) on thread? (2) support generic parameters like list ? ...

Examples of OpenGL programs with networking code?

Hello, I'm wondering if anyone has/knows of any examples of networking code integrated with OpenGL. Basically, I need to send position coordinates of something over a network to my OpenGL display... which would then draw the object at the correct position. The problem I'm having is integrating my UDP code with the game. I basically ...

Callbacks (Asynchronous Method Calls) within a Loop

Part of a C# application I'm writing requires collecting data from a service provider's database for each account associated to a user. When the user logs into the app a call is made to start updating the accounts from the service provider's database. Since lots operations are performed on the third party's end the process of getting the...

Shared Object Pool without Thread.Sleep?

I have developed an "object pool" and cannot seem to do it without using Thread.Sleep() which is "bad practice" I believe. This relates to my other question "Is there a standard way of implementing a proprietary connection pool in .net?". The idea behind the object pool is similar to the one behind the connection pool used for database ...

Can I load a web worker script from an absolute URL?

I haven't been able to get something like this to work: var myWorker = new Worker("http://example.com/js/worker.js"); In my Firebug console, I get an error like this: Failed to load script: http://example.com/js/worker.js (nsresult = 0x805303f4) Every example of web worker usage I've seen loads a script from a relative path....

Populating a ListView in a multithreaded app

I need to retrieve a set of data from a database, then populate a ListView with the data. I understand multithreaded form controls and the proper techniques for updating controls from worker threads. Here's the dilemma: I may have several thousand entries in the ListView... rather than Invoking the form thread to update them one at a ...

Core data, file downloads, and thread-safety

What's the preferred approach for constantly sharing data across threads when using Core Data? I am downloading a large file and want to show progress of the download in a UIProgressBar. The actual download is happening in a background thread created by NSOperation. The download information (local path, total bytes, bytes received) is ...

Threads in a J2EE application

I have a J2EE application that has two components: First is a service that scrapes some information from internet and fills it into database. Second is a web interface (deployed on tomcat) from where user can browse that information. What could be the best approach to implement the first component? Should it be run as a background Daemo...

Background Threads in C#

I am new to C#.I learnt that normally all threads are foreground until unless you explicitly specify it as "background" thread using IsBackGround= true . Some doubts popped in to my mind. 1) What is the advantage of keeping a thread as background thread? 2) When executing the folowing code : static void Main(string[] args) ...

Yahoo Multiplayer Games: What is the reason to have multiple rooms for a game ?

Yahoo has multiple rooms for a game. For example, let's choose Chess. For Chess, they have multiple rooms, and every rooms has multiple tables. What would be the reason to have multiple rooms ? Will the server be slower with 1 room and 10.000 tables than 10 rooms and 1000 tables for each room ? If yes, please make me understand why. I ...

Dispatch queues: How to tell if they're running and how to stop them.

I'm just playing around with GCD and I've written a toy CoinFlipper app. Here's the method that flips the coins: - (void)flipCoins:(NSUInteger)nFlips{ // Create the queues for work dispatch_queue_t mainQueue = dispatch_get_main_queue(); dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, NUL...

Standard practice for implementing threads in C++?

Hello SO World, I'm looking forward to an interview in C++ in the coming weeks. (yay) So I have been relearning C++ and studying up. Unfortunately I have realized that I've never implemented threads in C++, and am somewhat concerned about a quiz on concurrency. As far as I can tell, C++ uses pthreads in Linux and some other device in W...

Which Dispatcher to use? The Window's or the Control's?

Up to now when I wanted to update an UI control from a non UI thread I used syntax like: Dispatcher.Invoke(DispatcherPriority.Normal, new Action(()=>Label1.Content="New Content")); Now I am reading some more about it I keep finding the following syntax: Label1.Dispatcher.Invoke(//same arguments; Is the latter bett...

C# Joining Threads

I'm trying to obtain a good understanding of multi-threading in C# and I'm a bit confused about the applicability of the Thread.Join method. Microsoft says that it "Blocks the calling thread until a thread terminates." Two questions: Given the following example, which thread is actually blocked while the other is working toward termi...

Bitmap region is already locked, multi-threaded environment

I'm working in an API that calls the main function through multiple threads. I'm trying to access through that function a Bitmap in another class and write from it, but even after setting it to use completely different instance of the object I am experiencing an InvalidOperationException: Bitmap region is already locked. I've tried lo...