multithreading

Thread leak running webbrowser control in an asp.net web service.

I'm running a webbrowser form inside an asp.net WCF web service. I'm creating a second thread for the webbrowser form and then creating a third thread to run the message loop for the form. My problem is that I can't figure out how to stop the third thread and dispose of the webbrowser form. Without stopping the third thread then the seco...

Android: General Direction for Bluetooth SPP App with Multiple UI Activities (Multithreading/Handlers)

I am relatively new to Android but have some experience with Java. This may be more of a Multithreading/handler issue as apposed to Bluetooth. I am writing an Application that has multiple layouts with buttons. I have set up onClickListners for the buttons. Some buttons will change the activity and bring up a new layout with new button...

Can stuck Python threads hinder other threads if there are no shared resources?

I am considering utilizing Python to call various dlls that will perform things like accessing the LAN (on Windows) or making HTTP requests. These dlls might be poorly written and get stuck. My first question is, whether isolating these dll calls in Python threads will guarantee that the main Python thread will not get stuck? My second q...

What is a reliable way to run time consuming tasks in ASP.NET MVC2

I need reliable way to run 10 different tasks simultaneously. For instance the first one would be sending emails, while the next one is cleaning rows from a specific table... so on an so forth. I've used the Thread class and while it works well on my development machine (VS2010 internal web server) non of these threads seems to be worki...

Java get thread created by calling main

Hello! I have a client server application and for testing purposes I need to start the client in a test method by calling Client.main(); That creates some new thread. Now I need to wait until that thread is completed before performing assertions in my test. How do I know when this happens? Alternatively, how do I know, which thread wa...

Python: Setting sys.stdout to a wx.TextCtrl with Process/Thread leads to crashes

I've got a wx-gui that's piping stdout/stderr to two different text-controls. In the program I'm creating a process to run some data-crunching code, and I have a thread that joins the process and changes the global state when the process is finished. import multiprocessing as mp from threading import Thread t = Thread(target=self.joi...

How does multithreading work in Objective-C on the iPhone?

I'm confused about the concept of "threads" in iPhone development: Why are threads necessary / useful? How can threads be used in Objective-C? ...

halt servlet response

Hi to all! I'm facing the following problem. i have a servlet that serves a client request with a video clip. But this video clip is a product of another thread (transcoder). If the clip is not ready to be downloaded because the transcoder thread haven't finished its job, the client request fails! Any suggestions about how to deal with t...

Java class level lock vs. object level lock

If a thread T1 enters a method m1 by obtaining the class level lock, does this mean another thread T2 cannot run a different method m2 by obtaining the object level lock? ...

Severe multi-threaded memory bottleneck after reaching a specific number of cores

We are testing our software for the first time on a machine with > 12 cores for scalability and we are encountering a nasty drop in performance after the 12th thread is added. After spending a couple days on this, we are stumped regarding what to try next. The test system is a dual Opteron 6174 (2x12 cores) with 16 GB of memory, Windows...

How to execute code in the GUI Thread?

I have a FileSystemWatcher that react on the Changed event. I want to open the file, read its content display it in a textbox and hide the popup that has been created after 1 sec. The code almost work but something fail when hiding the popup. Here is a snippet of the code : txtLog.Dispatcher.Invoke(DispatcherPriority.Normal, (A...

How to Run an exe from windows service and stop service when the exe process quits?

I am a complete beginner to working with windows services. I have a basic skeleton worked out for the service and I am currently doing this: protected override void OnStart(string[] args) { base.OnStart(args); Process.Start(@"someProcess.exe"); } just to fire-off the exe at the start of the program. However,...

Sockets and threads using C.

I am new to both sockets and threads. I have this code: listen(socket_fd, 20); /* Looooop */ while (1) { newsocket_fd = accept(socket_fd, (struct sockaddr *) &client_addr, &client_len); if (newsocket_fd < 0) { error("ERROR on accept"); } pthread_t thread; ...

Parallelizing GDI+ Image Resizing .net

I've tried to parallelize the resizing of jpegs using .Net. All my tries failed, because the Graphics.DrawImage-func seems to lock while active. Try the following snipped: Sub Main() Dim files As String() = IO.Directory.GetFiles("D:\TEMP") Dim imgs(25) As Image For i As Integer = 0 To 25 imgs(i) = Image.FromFile(files(...

Delphi: Debug critical section hang by reporting call stack of running threads on lock "failure"

I'm looking for a way to debug a rare Delphi 7 critical section (TCriticalSection) hang/deadlock. In this case, if a thread is waiting on a critical section for more than say 10 seconds, I'd like to produce a report with the stack trace of both the thread currently locking the critical section and also the thread that failed to be able ...

ThreadPool QueueUserWorkItem with list

Hi I would like to use the QueueUserWorkItem from the ThreadPool. When I use the following code everything works well. private int ThreadCountSemaphore = 0; private void (...) { var reportingDataList = new List<LBReportingData>(); ThreadCountSemaphore = reportingDataList.Count; using (var autoResetEvent = new AutoResetEvent(false)) { ...

Consuming the results produced by an ExecutorService. Which class?

I wish I would have written the class/interface name down but I didn't... When looking through the JDK javadocs I saw reference to a class/interface with the purpose of collecting and consuming the results produced by an ExecutorService (completed Futures<T>s), possibly elsewhere in the system. At the time I took a mental note of it be...

Perl ithreads: Do some math instead of sleeping

I am using perl ithreads and things work fine, unless I decide to have threads sleep. Lets say my routine thread_job is passed as an entry for several threads to start running concurrently. thread_job() { ... sleep 2; #do other stuff here } If I dont have a sleep I have no issues with the threads running and they do their tasks f...

mySQL interface error only occuring if ran in Django

Hi all, I'm running a web crawler that gets called as a separate thread via Django. When it tries to store the scraped information I get this error: File "/usr/lib/pymodules/python2.6/MySQLdb/cursors.py", line 147, in execute charset = db.character_set_name() InterfaceError: (0, '') If I manually run the script from the command li...

Running mlutiple threads in CPU

Hi, All we know that JVM schedules the user threads in a single CPU based machine .Why cant a single CP run mltiple process/threads in parallel,What is the constrain stops that capability Also JVM is like a another software which is running in any machine,There may be thousands of other programs may waiting for the CPU cycle at a given...