multithreading

what is the best approach for implementing a thread timer

Hi, What is the best approach in using a timer. Use a System.Timer.Timer class or use a single Thread in a non-terminating loop with a Thread.Sleep statement? Thanks in advance ...

What is the best way, if possible, to send information from a Java PrintStream to a JTextPane?

In Java, I have a package that translates XML metadata from one standard to another. This package is ultimately accessed through a single function and sends all of its output through a PrintStream object. The output sent is just a status of each file and whether or not it was translated. This is pretty fine and dandy if I'm just print...

Thread is dead. State cannot be accessed

Hi All, I am using Multi-threading in my application in order to improve the performance of my application. I have a method where I had the return type as DataTable. But from what I followed in some articles, it is not advisory to invoke methods with return type. Hence, i passed an out parameter of type 'DataTable' inside the meth...

Whats the best way to get multiple instances of an application to run in Apache Tomcat?

I have an application that usually is hosted on a Windows 2003 Apache Tomcat server and integrates with clients websites. We were thinking about using Amazon's EC2 service as an alternative so we can work within a predictable hosting environment. Unfortunately, and for obvious reasons, you only get 5 Elastic IP addresses (static ip ad...

JavaFX Threading issue - GUI freezing while method call ran.

Hi everyone, I hoped someone might be able to help as I'm a little stumped. I have a javafx class which runs a user interface, which includes a button to read some text out loud. When you press it, it invokes a Java object which uses the FreeTTS java speech synth to read out loud a String, which all works fine. The problem is, when the...

Not Able to call The method Asynchronously in the Unit Test.

Hi everyone, I am trying to call a method that passes an object called parameters. public void LoadingDataLockFunctionalityTest() { DataCache_Accessor target = DataCacheTest.getNewDataCacheInstance(); target.itemsLoading.Add("WebFx.Caching.TestDataRetrieverFactorytestsync", true); DataParameters param...

Start a thread in a different process in Java

Hi there, is it possible to start a new thread in a different process in Java? I mean, I'm running a specific process and main thread, issuing ProcessBuilder for creating a new process. Before start() method is invoked, one must provide the command to be run in another process. Is it possible to start a new thread in newly created proce...

How to run background task in Outlook 2007 add-in efficiently?

I was hoping someone could point me in the right direction as far as how to run background task in Outlook 2007 while preserving a good User experience. I have a process that loops through each item in a default Outlook calendar and sends information (subject, location, etc.) to a back-end server. I have tried ThreadPool.QueueUserWorkIte...

Can I avoid a threaded UDP socket in Python dropping data?

...

Java threading problem

Hi! I'm using multiple threads in my application. Basically I have a combo box and upon selecting Inbox, p1 resumes and p2 is suspended and upon selecting Send, p2 starts and p1 stops. Below is the code (I'm sure it's not perfect) public void modifyText(ModifyEvent e) { if (combo.getText().equals("Inbox")) ...

Multi-threading mechanisms to run some lengthy operations from winforms code and communication with GUI

What do I want to achieve: I want to perform some time consuming operations from my MDI winforms application (C# - .NET). An MDI child form may create the thread with the operation, which may take long time (from 0.1 seconds, to even half hour) to complete. In the meantime I want the UI to respond to user actions, including manipulatio...

Does a PageAsyncTask fire off its own thread?

Does a PageAsyncTask fire off its own thread when used in a .aspx page? ...

Java process problem in Eclipse

Hi! This is my code: final String run_tool ="cmd.exe /C pelda.exe"; final Process tool_proc = null; Runnable doRun = new Runnable() { public void run() { try { tool_proc = Runtime.getRuntime().exec(run_tool); } catch (IOException e) { e.printStackTrace(); } } }; ...

Me.Invoke in VB.NET doesn't actually "Invoke" - threads stall on Invoke statement

I've got the following code: Public Delegate Sub SetStatusBarTextDelegate(ByVal StatusText As String) Private Sub SetStatusBarText(ByVal StatusText As String) If Me.InvokeRequired Then Me.Invoke(New SetStatusBarTextDelegate(AddressOf SetStatusBarText), StatusText) Else Me.labelScanningProgress.Text = StatusText ...

Java process inputstream in thread

Hi! I develop an Eclipse plugin and I have a problem My code is the following one: String run_pelda = "cmd.exe /C pelda.exe"; Runtime pelda_rt = Runtime.getRuntime(); Process pelda_proc = javacheckgen_rt.exec(run_pelda); And after I would like to read the inputstream: InputStream toolstr = tool_proc.getInputStream(); InputStreamRea...

How to save objects using Multi-Threading in Core Data?

I'm getting some data from the web service and saving it in the core data. This workflow looks like this: get xml feed go over every item in that feed, create a new ManagedObject for every feed item download some big binary data for every item and save it into ManagedObject call [managedObjectContext save:] Now, the problem is of cou...

STAThread and Process output capture in c#

Hi: This is a strange problem I encountered. I have an window application written in c# to do testing. It has a MDI parent form that is hosting a few children forms. One of the forms launch test scripts by creating processes and capture the scripts output to a text box. Another form open serial port and monitoring the status of the devi...

No output from exception

Why does this code not print an exception stack trace? public class Playground { /** * @param args */ public static void main(String[] args) { startThread(); } private static void startThread() { ScheduledExecutorService timer = Executors .newSingleThreadScheduledExecutor(); ...

In .NET, what thread will Events be handled in?

I have attempted to implement a producer/consumer pattern in c#. I have a consumer thread that monitors a shared queue, and a producer thread that places items onto the shared queue. The producer thread is subscribed to receive data...that is, it has an event handler, and just sits around and waits for an OnData event to fire (the data...

Linux's thread local storage implementation

__thread Foo foo; How is "foo" actually resolved? Does the compiler silently replace every instance of "foo" with a function call? Is "foo" stored somewhere relative to the bottom of the stack, and the compiler stores this as "hey, for each thread, have this space near the bottom of the stack, and foo is stored as 'offset x from bottom...