multithreading

handling sleep in java scheduled executor service

hi All, I have a sort of complex problem like below. - we have a real time system with large number threads requirement. In order to optimize the performance, we are thinking of following design. create a thread pool executor with max number of threads each thread is used to create scheduled executor service. now the tasks a...

GetThreadId on pre-vista systems?

Apperantly, GetThreadId is a Vista API. How can I get a thread's id on pre vista systems? ...

View not Updating

Kinda new to iPhone programming and was experimenting with threads - (void)viewDidLoad { [super viewDidLoad]; [NSThread detachNewThreadSelector:@selector(changeMain) toTarget:self withObject:nil]; [NSThread detachNewThreadSelector:@selector(changeThread) toTarget:self withObject:nil]; } - (void)changeMain{ NSAutoreleas...

Executor and Daemon in Java

Hi, I have a MyThread object which I instantiate when my app is loaded through the server, I mark it as a Daemon thread and then call start() on it. The thread is meant to sit and wait for information from a queue as long as the application is active. My problem/question is this: Currently MyThread is extending Thread because I mark it a...

Testing a C# sockets based multithreading server

We're developing a server application that uses sockets to handle client communication, obviously we want to test the server. Does anyone know of a good (open source) harness that can test the server using multiple threads on multiple client machines? ...

Should thread blocked by java NIO Selector.select() be considered waiting or running

The documentation of selectorObj.select() method states This method performs a blocking selection operation. It returns only after at least one channel is selected, this selector's wakeup method is invoked, or the current thread is interrupted, whichever comes first. I understand the documentation The thread that is b...

WCF Service Not Returning Current Values?

I am using VB.NET, 3.5 Framework. I created a WCF Service running as a console application. It is doing event listening for my workflow engine. The second application I am trying to do is a WinForm that can monitor the service and return me back the current states of the engine's workers. I am able to connect to the service fine, and ...

Threaded drawing on the iPhone

Apples documentation states that in general Quartz2D is thread-safe. However when drawing to an image context during a NSOperation I'm experiencing crashes (EXC_BAD_ACCESS). This is my current setup: UIGraphicsBeginImageContext(imageSize); CGContextRef context = UIGraphicsGetCurrentContext(); // drawing code UIImage *image = UIGraphic...

Why use the ServletContext object in a web-app containing servlets and "worker" threads in Java

Hi, I currently have a web-app where I have Servlets reading and writing to the ServletContext attributes and I have "working" Threads (Daemon threads) which get initialized on startup and currently hold as a member the ServletContext object. For a couple of reasons I'm thinking of moving to "implement Runnable" instead and I'm kind of s...

Errors with Indy in threaded application !

Hi, I've got some memories leak related to TidHTTP when it's waiting for the response of a server after a GET and that the thread is being terminated. Example : aThread = class(TThread) private FidHTTP :TidHTTP; FCommand :String; public procedure Execute(); override; constructor Create(aCommand :String); override;...

Finding usage of resources (CPU and memory) by threads of a process in unix (solaris/linux)

I have a multi-threaded application(C++ and pthread library) and I will like to know how much resources(CPU and memory) each thread uses. Is there a way to find out these details on Solaris and Linux both or on either of them. ...

Multithread safe logging

We have an application that runs in multiple threads and uses Log4Net as logging framework. We encountered a scenario where some log events weren't logged. As mentioned in the docs, the FileAppender and the other Appenders are "not safe for multithreaded operations". I searched the web for solutions or Appenders, but couldn't find any. ...

Multi-threaded access to MySQL using ADO.Net

I'm developing an ASP.Net web application which makes use of MySQL via the MySQL-Provided Connector/NET, which is an ADO.Net-compatible interface. My understanding of ASP.Net is that concurrent requests will be processed in separate threads, so my code will need to be thread-safe. I can't find anything in the MySQL documentation that ex...

Why can't I change the Thread.Name in .NET?

System.Threading.Thread.Name is a write-once property. I can assign to it at once, and only then if no other assignment has been made by application or library code. I am writing a multi-threaded event-driven application and would very much like to be able to change the name of the currently executing thread depending on the task its per...

Is it a bad idea to write a multithreaded TCP server daemon in Perl?

Is it a bad idea to write multithreaded programs (specifically, TCP server daemons) in Perl? ...

How to prove that multithreading is working?

How can I prove that multithreading is working in my C# programs? This is for a testing requirement. For example, I'm going to have to add some locking to a logger class (yes I know, I shouldn't have written my own logging class), and I need a test case to prove that the change will work. ...

How to pause / sleep thread or process in Android ?

I want to make a pause between two lines of code, Let me explain a bit : -> the user clicks a button (a card in fact) and I show it by changing the background of this button : thisbutton.setBackgroundResource(R.drawable.icon); -> after let's say 1 second, I need to go back to the previous stade of the button by changing back its ba...

How to convert Text to Wave using SAPI with multithreading?

I am trying to convert text to wave file using following function. It works fine if called from main UI thread. But it fails when calling from another thread. How to call it from a multi-threaded function? void Pan_Channel::TextToPlaybackFile( CString Text, CString FileName ) { // Result variable HRESULT Result = S_OK; // Voice Obje...

Multithreading in wxWidgets GUI apps?

Hello there, I'm having problem (basically, I'm confused.) while trying to create a worker thread for my wxWidgets GUI application that WILL MODIFY one of the GUI property itself. (In this case, wxTextCtrl::AppendText). So far, I have 2 source files and 2 header files for the wx program itself (excluding my own libs, MySQL lib, etc), s...

Does Creating a New Thread Duplicate File Descriptors and Socket Descriptors in Linux?

Everyone knows the classic model of a process listening for connections on a socket and forking a new process to handle each new connection. Normal practice is for the parent process to immediately call close on the newly created socket, decrementing the handle count so that only the child has a handle to the new socket. I've read that...