multithreading

Why is CoRegisterClassObject creating two extra threads?

I'm trying to fix a problem that only recently happens on a number of machine's on a VPN. They each run a client application I wrote that exposes a COM automation object. For some strange reason I haven't been able to discover yet, one thread in the application takes up all of the available CPU time, slowing other operation on the machi...

Is Ruby's Net::HTTP threadsafe?

Is Ruby's Net::HTTP threadsafe? (Aside from the version_1_1 and version_1_2 methods which it explicitly says aren't) ...

deleting a file in java while uploading it in other thread

i'm trying to build a semi file sharing program, when each computer acts both as a server and as a client. I give multiple threads the option to DL the file from my system. also, i've got a user interface that can recieve a delete message. my problem is that i want that the minute a delete message receieved, i wait for all t...

VB.net: Is my Thread Safe List Solution actually safe?

I've added the following Extensions to my Project in order to create a thread safe list: Extensions If I want to conduct a simple operation on my list <Extension()> _ Public Sub Action(Of T)(ByVal list As List(Of T), ByVal action As Action(Of List(Of T))) SyncLock (list) action(list) End SyncLock ...

Running and managing NSTimer in different NSThread/NSRunLoop

I'm writing a Cocoa application, with a GUI designed in Interface Builder. I need to schedule background activity (at regular intervals) without blocking the UI, so I run it in a separate thread, like this: - (void)applicationDidFinishLaunching:(NSNotification *)aNotification { [self performSelectorInBackground:@selector(schedule) w...

Best way to identify and dispose locked thread in java.

I have to call a function 3rd party module on a new thread. From what I've seen, the call either completes quickly if everything went well or it just hangs for ever locking up the thread. What's a good way to start the thread and make the call and wait for a few secs and if the thread is still alive, then assuming it's locked up, kill (o...

VS2010 Threads window shows 25 threads and Process.Threads.Count.50 Why?

VS2010 Threads window shows 25 threads and Process.Threads.Count.50 What are the other 25 are doing? ...

c++ process cpu usage jump causes detection

Given: multithreaded (~20 threads) C++ application under RHEL 5.3. When testing under load, top shows that CPU usage jumps in range 10-40% every second. The design mostly pretty simple - most of the threads implement active object design pattern: thread has a thread-safe queue, requests from other queues are pushed to the queue, while t...

iPhone Multithreaded Search

I'm sort of new to any sort of multithreading and simply can't seem to get a simple search method working on a background thread properly. Everything seems to be in order with an NSAutoreleasePool and the UI being updated on the main thread. The app doesn't crash and does perform a search in the background but the search results yield th...

Generic GDI+ Error when saving image.

Hi, I i have a very simple C# Form with a thread that get's an image and saves it into a folder. In the ** line I get a Generic GDI+ Error, I believe that it's a multithreading issue. This is the code of the thread: int seqId = SeqId; int num = 0; while (true) { string directoryPath = @"C:\tests\sequencias\seq-"...

perl multiple tasks problem

I have finished my earlier multithreaded program that uses perl threads and it works on my system. The problem is that on some systems that it needs to run on, thread support is not compiled into perl and I cannot install additional packages. I therefore need to use something other than threads, and I am moving my code to using fork(). T...

how do twisted/tornado et cetera work

I understand that they work in some way distinct from making a thread per user. How exactly does that work? (Does 'non-blocking' have something to do with it?) ...

My Produce Consumer Hangs

Please copy the program below and try running in your IDE. It's a simple Produce Consumer implementation - it runs fine when I use one Producer and one Consumer thread but fails when using 2 each. Please let me know the reason why this program hangs or is there anything else wrong with it. import java.util.LinkedList; import java.util.Q...

Close if no active threads, or if any active, then wait till it's complete and close

My application overview is ASP.Net webservice entertains requests from various applications for digital signing and verification via a client. The webservice will then route these requests to a smart card When the system date changes, I want the following to happen. New request from the clients are made to wait Current work between...

C# How to count managed threads in my AppDomain?

Is there a way to find out how many managed thread I use (including ThreadPool)? When I get count of unmanaged threads through GetProcess I have an insane number of it (21 at very beginning) ...

Singleton & Multi-threading

Friends I have the following class that class Singleton { private: static Singleton *p_inst; Singleton(); public: static Singleton * instance() { if (!p_inst) { p_inst = new Singleton(); } return p_inst; } }; Please do elaborate on precautions taken while implementing Sing...

Does a java agent run in a separate thread?

I feel that this is something I should know, but does a java agent (specified with -javaagent) run in a separate thread? I've read that a Java agent is a pluggable library that runs embedded in a JVM and intercepts the classloading process, but I want to make sure: does it really intercept them (which sounds like it's running in another ...

New to threading in C#, can you make thread methods generic and what are the dangers?

Hey all, I'm just now starting to get into the idea of threading, and wanted to know if I could make this more abstract. Both foo and bar derive methods from a base class, so I'd like to pass in one or the other and be able to do work using a method that was derived. I'd also like to know how you properly name threads and the methods in...

Writing a search engine

Hello all, The title might be a bit misleading, but I couldn't figure out a better title. I'm writing a simple search engine which will search on several sites for the specific domain. To be concrete: I'm writing a search engine for hardstyle livesets/aftermovies/tracks. To do I will search on the sites who provide livesets, tracks, and...

Delphi - threads and FindFirst function

Hi, I'm encountering a big problem when i'm trying to make a recursive search function inside a thread (using delphi 7) bellow is the code: TParcFicDir = class(TThread) private several variables.. protected procedure Execute; override; public constructor Create(CreateSuspended: Boolean); constructor TParcFicDir.Create(Cr...