multithreading

User-mode synchronization library for C++

Does anyone know of a Windows user-mode thread synchronization library for C++ (utilizing spin locks / atomic operations)? I only need mutexes (~critical sections), but condition variables would be a plus. ...

What and how much overheads happen when I use a Reference class?

I saw there is a daemon thread running whenever we create a referenced object using any Reference class like WeakReference, FinalReference, SoftReference, PhantomReference, Referemce And if we have hierarchal thread structure then at each level there is an extra daemon thread initiated. ...

MultiThreading in C# and how to handle

Hi All, I have a requirement in which i need to call webservice 12 times for one request. What i am planning creating that number of threads and call the service from ThreadStartMethod ... Now the questions are I need to kill all other threads if i got proper result from any of the response I heard killing thread by using Thread.a...

Running 30 php script at once in the background

I have a PHP script that must run 30 parallel times each with a different argument. What is the best way to do this so that each script can have as much even exposure to the processor as possible? ...

Objective-C/Cocoa threads and messaging conundrum

Hello, I have a problem that has been plaguing me for awhile now, I have come up with a solution which I will detail below, and although it seems to be working well I'm not super enthusiastic about it from a design point of view and I'm curious if anyone would have any recommendations about a better way to do this. Basically, I have a s...

When should I use ConcurrentSkipListMap?

In Java, ConcurrentHashMap is there for better multithreading solution. Then when should I use ConcurrentSkipListMap? Is it a redundancy? Does multithreading aspects between these two are common? ...

ASP.NET/C# Events difference

Possible duplicate: What is the difference ManualResetEvent and AutoResetEvent in .net? What is the difference between ManualResetEvent and AutoResetEvent ? (Example could be helpful). ...

When can lock(syncObject) throw an exception?

I have written a com component in .NET and if I try to take a lock on any object in any method (that is invoked by unmanaged code talking to my com component) I get an exception. I do not have the exact text of the exception at this moment but it wasn't much helpful either. So my question is under what circumstances a lock(syncObject) ...

Thread monitoring for scala actors

Is there a way to monitor how many threads are actually alive and running my scala actors ? ...

Do we have a thread library that is compatible with Turbo C?

Currently I am developing a program for academic purpose. We use Turbo C because we are requesting for interrupt directly with the hardware. We can do anything for our project, and I've already chosen a topic. The thing is I think I really need 2 threads in my program. Are there any thread libraries that are compatible with Turbo C in ...

PHP: Multithreaded PHP / Web Services?

Greetings All! I am having some troubles on how to execute thousands upon thousands of requests to a web service (eBay), I have a limit of 5 million calls per day, so there are no problems on that end. However, I'm trying to figure out how to process 1,000 - 10,000 requests every minute to every 5 minutes. Basically the flow is: 1) Ge...

Using legacy COM component in C# multithreaded Environment

Hi I have legacy COM component, and my mission is to write web service that wrap the COM and enable concurrent non-blocking calls. First of all, because the COM object itself is stateless, i decided to use the [ThreadStatic] attribute so each thread will have its own instance of the COM object to prevent the use of lock { } statement a...

recursive file search thread

i have a routine that searches files: procedure RecSearch(const sPathName, sFile : String; const subDir : Boolean); var sr : TSearchRec; sPath : String; begin Application.ProcessMessages; sPath:=IncludeTrailingBackslash(sPathName); if FindFirst(sPath + sFile, faAnyFile - faDirectory, sr) = 0 then repeat lstBox...

When should one use actors to solve a concurrency problem?

I have been looking at the Actor Model for a while now. To me it seems to be just another approach towards concurrent programming with its own upsides and downsides. It certainly does not guarantee deadlock-free environment. A can wait for a message from B while B waits for a message from A. I don't know if we can say the actors approac...

Is there a use case for creating threads without synchronization and locks?

Since thread execution happens in a pool, and is not guaranteed to queue in any particular order, then why would you ever create threads without the protection of synchronization and locks? In order to protect data attached to an object's state (what I understand to be the primary purpose of using threads), locking appears to be the only...

Python: How to shutdown a threaded HTTP server with persistent connections (how to kill readline() from another thread)?

I'm using python2.6 with HTTPServer and the ThreadingMixIn, which will handle each request in a separate thread. I'm also using HTTP1.1 persistent connections ('Connection: keep-alive'), so neither the server or client will close a connection after a request. Here's roughly what the request handler looks like request, client_address =...

How to reload controls without getting other controls stuck?

I handled a click event to a button. It calls control1's animation function and control2' reloading content function. However, control1's animation will being "hanging" for a second while contorl2 is reloading content. How can I reload control2's content without blocking other controls on the UI? My second question is how can I use b...

Locks in Synchronized Blocks.

I just need a confirmation that i have understood the concept of locks in synchronized blocks correctly. First I will tell what I have understood. Acquiring a lock of an object means that no other thread can access the synchronized code of the object's class. In case of synchronized methods, Threads acquire lock on the object used to inv...

Multi-threading with Linq to SQL

I am building an application which requires me to make use of DataContext's inside threads. My application keeps throwing InvalidOperationException's similar to: There is already an open DataReader associated with this Command which must be closed first ExecuteReader requires an open and available Connection. The connection's current s...

Threading.Timer invokes asynchronously many methods

Hi guys! Please help! I call a threading.timer from global.asax which invokes many methods each of which gets data from different services and writes it to files. My question is how do i make the methods to be invoked on a regular basis let's say 5 mins? What i do is: in Global.asax I declare a timer protected void Application_Start() ...