multithreading

Is there a way for one .NET Control to contain another Control which is owned by a seperate GUI thread?

I'm looking at creating a tabbed interface which has user controls (possibly written by plug-in developers) within a tabbed or MDI interface. These plug-in controls could unintentionally freeze their GUI thread, and I'd prefer that they not influence user controls in other tabs. Much like Google Chrome creates a process for each tab; b...

One reader, many writers

Related: How to catch exceptions from a ThreadPool.QueueUserWorkItem? I am catching exceptions in background threads started by ThreadPool.QueueUserWorkItem(), and propagating them to the main thread via a shared instance variable. The background threads do this: try { ... stuff happens here... } catch (Exception ex1) { lock...

How to integrate an external process which is invoked repeatedly into a Java webapp?

I am trying to integrate a non-Java executable into a Java webapp on the server-side (Linux). Some details about the executable: Written in C++. The executable takes some input either from stdin or file and generates an output file. The executable is not designed to be a long running process i.e it generates an output and then dies out...

Java Socket's app randomly stopping

Server public void run () { Socket serversocket = new ServerSocket(port); while(true) { new Thread(new ServerThread(serverSocket.accept())).start(); } } //serverSocket.close(); etc ServerThread public void run() { BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream())); String input; w...

Problem With thread

hi I am doing a project in ftp,which will do multiple uploads,and the process i am doing is compressing the file then encrypting then cut into several pieces and send it to the server i assign all these things to a thread.likewise a thread will be there for every file i assign . this is the new piece of code and it has only one fu...

Ruby specific thread semantics

I just ran across an issue that probably exposes my ignorance of common threading semantics. I assumed that the following ruby was valid: d = Thread.new{ Thread.stop } d.join That is, I thought that joining a stopped thread would simply be a NOP - the thread is already finished, so join should return immediately. Instead, Ruby-...

Threading issue in C#

can somebody tell me why my code is not working? class Connection { public static StreamWriter writer; public static string SERVER; private static int PORT; private static string USER; private static string NICK; private static string CHANNELS; private Thread connection; private Thread ping; public Co...

C# Thread and Class problems

Okay, so i have this code i wrote: class Connection { public static StreamWriter writer; public static string SERVER; private static int PORT; private static string USER; private static string NICK; private static string CHANNELS; private Thread connection; private Thread ping; public Connection() ...

Is AtomicInteger a good solution to provide a counter for multithreaded app ?

I have an android client which will make Http connections to a server. The server requires that all Http request provide a monotonically increasing counter in the Http header. e.g. POST /foo/server X-count: 43 Places that will initiate Http connections: Inside activities under the user's command e.g. button clicks Inside a Service ...

Splash screen display method best practice C#

I am showing a splash form by starting a new thread immediately before running my main form. In the method that is run by this thread, I am using Application.Run as shown in Option 1 below. Is this a correct way of doing this, or are there problems waiting for me becaue I have called Application.Run twice? An alternative is Option 2, al...

How using readerwriterlock correctly

Hello i need to user writerreaderlock in my method. I want to know how use it correctly. I got a dictionnary of ObjectA public class ObjectA { public ReaderWriterLock RWL {get;set;} public ObjectB obj {get;set;} public ObjectA() { RWL = new ReaderWriterLock(); } } public class ObjectB { int TTL {get;set;} string Value {get;set;} } ...

How to synchronize and combine results from multiple threads in C++?

I have a data feed continuously feeding data packet in. There are 5 threads(A, B, C, D, E) processing the data packages. Note the 5 threads have totally different speed and they generate 5 different features(each thread generate 1 feature) for every incoming data package. The 5 threads are at different pace: when A has finished analyzin...

Multithreading in WCF with accurate timer requirement

I have a WCF app that accepts requests to start a job. Each job needs to do something after exactly X minutes (e.g. 5 mins.), there can also be a job request at any time and simultaneously. This is what I have in mind, // WCF class public class RequestManager { // WCF method public void StartNewJob() { // start a new...

To make a choice between ManualResetEvent or Thread.Sleep()

I am not sure which strategy to adopt...I am focusing on my operation getting completed, but I'd also like to keep performance issues to a min too...there is a method called Execute() which has to wait (run synchronously) until an operation completes. This operation happens on another thread. There are 2 ways to implement the same thing....

Cross-Platform equivalent to windows events

I'm trying to port some Windows code to Linux, ideally through platform-independent libraries (eg boost), however I'm not sure how to port this bit of event code. The bit of code involves two threads (lets call them A and B). A wants to do something that only B can, so it sends B a message, then waits for B to say its done. In windows t...

flex/lex yacc/bison multithreaded environment

Can I use the code generated by flex/bison|lex/yacc in a multithreaded environment ? I'm afraid there are a lot of global variables. How can it be fixed ? ...

Several tasks run periodically in one .NET winform app.

I will do several tasks periodically in my app, but they have different period, how to do this? run each task in a separate timer thread. run all the period task in the same timer thread, but check the time to see if the task should be activated. do you have any better solution? ...

Browser timeout and page cannot be displayed

Hi, I have written within a JSP page to have Thread.sleep() for more than 1 hour. The JSP is deploayed on WebLogic server 9.2. I am trying to check the browser timeout and page cannot be displayed error. As per the below documentation, the default timeout for IE6 is 60 seconds. However, I was testing the above JSP and did not get any t...

How to determine Stack size of a Program in linux?

How does one determine the current stack size of a program in linux? it is said that the stack size of each program will be 8 MB in linux but when you use cat /proc//mmap it shows a different size. Also, how does one determine stack size of associated threads? Since it is said that threads have their own private stack? ...

C#/.NET: How to get the thread id from a thread?

In C# when deubgging threads for example, you can see each thread's ID. But I couldn't find a way to get that same thread, programmatically. And I couldn't even get the id of the current thread (in the properties of the Thread.currentThread). So I wonder how does Visual Studio get the ids of the threads, and if there's a way to get the h...