multithreading

cx_Oracle, generators, and threads in Python

Hi all, What is the behavior of cx_Oracle cursors when the connection object is used by different threads? How would generators affect this behavior? Specifically... Edit: The original example function was incorrect; a generator was being returned by a sub function, yield wasn't used directly in the loop. This clarifies when finally...

Timing a method and threads in .NET

I have two threads in my app - the main UI thread and another thread initiated by the wm_WiiMoteChanged event handler (a background thread). In the main thread I do some video processing. I have a function called processFrame shown below. I use that code to measure the time to process each frame and thus the frames per second rate. If I...

Thread-exclusive data: how to store and access?

Is there a possibility in .NET to bind an object instance to a current execution context of a thread? So that in any part of the code I could do something like CurrentThread.MyObjectData.DoOperation() and be sure that I access thread-specific data? thanks! ...

Pygame and threading: locked when accessing to globals?

Hi everyone. I am programming a game using pygame. I intend to control one of the characters using OpenSoundControl (OSC), a udp-based protocol for realtime communication. Basically I am using simpleOSC module to biund some OSC commands to functions on my pygame program. My game structure is something like this (this is a simplificatio...

Not to Able analayze the Core dump issue for Multithreaded application.........(Help Required)

I am working on multhithreading application when ever the process dump it always generates core as shown below i am not able to understand where it is actually dumping. GNU gdb Red Hat Linux (6.5-25.el5rh) Copyright (C) 2006 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welco...

How to slow down a single directory for debugging?

I'm currently trying to reproduce a bug that I think is caused by thread synchronization error. Sadly the bug does only occurred on the customer site but not on my development machine. Since those threads involve HDD access that is extremely slow at the customer site (about 1 MB/s) I think that the reason why I can't reproduce the bug ...

Cocoa: Processing thread results, and queuing multiple sheets.

Hello, I have a multithreaded application that has many concurrent operations going on at once. When each thread is finished it calls one of two methods on the main thread performSelectorOnMainThread:@selector(operationDidFinish:) // and performSelectorOnMainThread:@selector(operationDidFail:withMessage:) When an operation fails, I l...

What happens to Monitor.Enter without a matching Monitor.Exit?

If you have some blocks of code that you would like to prevent execution of when the object is being exited and cleaned up, could a lock be used to prevent the execution? Monitor.TryEnter(cleanupLock, ref acquiredLock); TryEnter could be used to ensure that the code is not executed, and since it does not wait for the lock there will n...

Shutting down multithreaded NSDocument

I have an NSDocument-based Cocoa app and I have a couple of secondary threads that I need to terminate gracefully (wait for them to run through the current loop) when the users closes the document window or when the application quits. I'm using canCloseDocumentWithDelegate to send a flag to the threads when the document is closing and th...

Java - how to make "runnable" JTable?

Hello, I have problem creating JTable, which will show every second some text. I make MainView, place JTable and have Class "TableHandler(JTable table) implements Runnable" which is supposed to add some text in intervals to JTable ... Here is run method : public void run() { for (int i=0; i<5; i++) { table.setValueAt("text",...

How to implement dispatcher feeding a multithreaded reader pool

I have a decoder that acts as a producer and places decoded video frames at a shared memory buffer. I have consumer processes that each runs on a separate thread, reads a frame and processes it. I would like to implement a dispatcher process thread that Checks the shared memory buffer and sends teh next unread frame to a selected consu...

Return values from Java Threads

I have a Java Thread like the following: public class MyThread extends Thread { MyService service; String id; public MyThread(String id) { this.id = node; } public void run() { User user = service.getUser(id) } } I have about 300 ids, and every couple of se...

Shutting down a multithreaded application

I'm trying to write a ThreadManager for my C# application. I create several threads: One thread for my text writer. One thread that monitors some statistics. Multiple threads to perform a large sequence of calculations (up to 4 threads per core and I run my app on a 2x quad core server). My application normally runs for up to 24 hours ...

thread safe queue isn't thread safe if peek returns a reference even if reference is never used (with assembly!)

I have a very simple queue implementation that wraps a fixed array. It contains peek, enqueue, and dequeue. If peek returns a reference, I've found that it will return conflicting results eventually (conflicting results meaning it will return 2 different values without any intervening dequeues or enqueues). Obviously, this could happen i...

Do you like this idea? (About threads).

Would it not be nice to be able to start a thread like this. Sub DoStuff() Using MyThead = New Threading.Thread() 'Do stuff on MyThread. End Using End Sub It is much less code to write and looks nicer than: Sub DoStuff() Dim MyThread As New Threading.Thread(AddressOf DoStuffThread) MyThread.Start() End Sub Sub...

help with mixing widget painting and UDP data transfers in a multi-threaded context

Here is what I need to do. -I receive log data through a udp connection -I stack relevant data in a qlist -I have a timer running in the main thread that, on timeout, unstacks this data, updates some arrays then calls widget->update -The widget re-implements paintEvent and uses these arrays to draw charts. What would be the best way ...

can a multithread program still be running after killing it in system monitor

Is it possible that a program which does not kill its threads properly before exiting still be running some piece of code somewhere even though it has been killed in system monitor? I am running ubuntu in a non virtual environment. My application is made with QT, it contains QThreads, a main thread and concurent functions. ...

Is There any Following C++ Blocking Condition Variable

I would like the have the following Blocking Condition Variable Once the blocking condition variable had been signaled, all threads will not wait on the particular condition variable The condition variable can be unsignaled anytime. Once condition variable had been unsignaled, all threads will be waiting on the variable I look at ht...

Need an example showing how to do async HTTP requests.

Im using a web service, so I want to use an async thread for the HTTP authentication request and another thread later to make additional service requests while my main thread runs. Would like to see a good example of how to do this and how to show busy messages somehow in main app. How does the main app know when the thread finished? An...

How can I store per-thread state between calls in Perl?

Now from what I understand under Perl ithreads all data is private unless explicitly shared. I want to write a function which stores per thread state between calls. I assume that a side effect of all data being thread private by default would allow me to use a closure like this: #!/usr/bin/perl -w use strict; use threads; { # closur...