multithreading

iPhone Core Data and Multithreading

I have an iPhone application I am developing which transfers data over the network and saves the data received in core data object for use later on. Presently. it works correctly in a single thread but I am working on converting the data transfer mechanism to run in a separate worker thread. I've read the core data programming guide on...

Would it make sense to have two GUI threads for two independent forms?

At work we've got a very CPU-intensive Windows Forms application. It's running on a server with 24 cores. As the Windows Forms model involves a single GUI thread processing a message pump, it seems that a rich, complex GUI is not making good use of the capabilities of the system. Am I wrong in saying this? So my coworkers were discussi...

Implementation of Threading in PHP

Can anybody please describe about how to implement threading in PHP programming? What I know for sure is that PHP does not support thread concept. However, please correct me if I'm wrong. If possible, please try to provide some details with one example about PHP threading. If possible, can anybody please also provide some details o...

Threads, queue and workflow

(As justification - I've never worked with threads so the description below is just an idea I want you to criticize) The task overview: - There is a list of some Objects - We need to check if the object has been changed in some way - If it was changed - apply some logic (for example - show notify). This is how I think it should be impl...

Why does java thread wait() work only with time limit in here?

Hi, I am trying to get familiar with Java threads for the SCJP and I had a question. In the below-written code i simply created: two Runnables with a common data storage (an array) and a synchronized write() method to fill it with data successively leaving a letter as a mark for each Runnable (A and B) in sequence. I know the code...

How is the Actor Model working compared to threads?

Is there any good and short explanation of how the Actor Model is working compared to threads? Can't a thread be seen as an actor and send messages to other threads? I see some difference, but it's not that clear for me. Can I use the Actor Model in any language by using threads differently? ...

Recommendations on books for multi-threaded data structures?

I need some recommendations of books/links that discuss design on multi-threaded data structures for an intermediate level C++ developer who knows STL/Boost and pthreads individually but would now like to blend these 2 knowledge streams. Any help appreciated. ...

Multi thread worker thread status

I create my threads as for (int i = 0; i < threadCount; i++) { Searcher src = new Searcher(i, this); threads[i] = new Thread(new ThreadStart(src.getIpRange)); threads[i].Name = string.Format(i.ToString()); } foreach (Thread t in threads) { t.Start(); } with threadCount(= 100, 150, 255 etc...) but I can...

Static properties in C++

With pseudo code like this: class FooBar { public: int property; static int m_static; } FooBar instance1 = new FooBar(); FooBar instance2 = new FooBar(); If I set property of instance1, it would obviously not effect the second one. However, if I set the static property instead, the change should propagate to every instance of...

Multithreaded data processing hanging on PostgreSQL

Hello, I'm trying to use the 8 threads from my new processor to handle transactions on the PostgreSQL database. It have to process geographic data in PostGIS, what I already do with just 1 processor core (one thread). I'm using Java (JDBC4) to create one Connection for each thread. Each connection receives the job to process groups of g...

Best way to process files from multiple threads in Java?

I currently have a Java program that spawns 50 threads and the goal is to look at a directory that has many files being written to it and upload those files to an ftp server and then remove them. Right now I have a super hacky way of looping through the dir in each thread and setting a lock on a ConcurrentMap to keep track of when a thre...

User thread spawning in Jetty

I have a web application running over Jetty, and I need to spawn a thread for idle connection handling. This thread is being started in the spring context. I know it's not a good practice to spawn threads in a container, but couldn't find a better way to do this. Any ideas? ...

Delphi - Cross-thread event handling

I have a small client-server application, where server sends some messages to the client using named pipes. The client has two threads - main GUI thread and one "receiving thread", that keeps receiving the messages sent by server via the named pipe. Now whenever some message is received, I'd like to fire a custom event - however, that ev...

Update BindingList<> from a background Thread?

I was wondering how I would use the Dispatcher in WPF to safely update my BindingList collection from another thread? I am also open for other solutions, Many Thanks, Kave ...

java inputStream Freezing

Im trying to run a thread that goes to a socket, grabs the input stream, and reads it. Im creating hundreds of these threads and have set the timeout for reading and yet the thread still stays at the read() line. public void readPack() { socket.setSoTimeout(4*1000); if (socket.isConnected()) { buffer parse = new buffer(); ...

How to check the utilization of USERPostMessageLimit on Windows using C++?

We have a multi-threaded C++ app which is mis-behaving. Fixing a corner-case bug properly would likely be a lot of work. Putting a patch on a bullet wound in combination with something else might do the trick. Due to too many heavy (GUI) threads being spawned, we are running over the limit of messages, which is defined in: HKLM\Software...

ArrayList and Multithreading in Java

Under what circumstances would an unsynchronized collection, say an ArrayList, cause a problem? I can't think of any, can someone please give me an example where an ArrayList causes a problem and a Vector solves it? I wrote a program that have 2 threads both modifying an arraylist that has one element. One thread puts "bbb" into the a...

handling more than one request...

I am writing an ordering system. In this program, the user can request food. For this purpose I have a class named User and a class named Food. In the class Program I have a field which is a list field that contains foods object. In the class Program I also have a field of user object. Now I am a bit confused. The thing is if two us...

Thread safe StreamWriter C# how to do it?

What is the best way to build a program that is thread safe in terms that it needs to write double values to a file. If the function that saves the values via streamwriter is being called by multiple threads? Whats the best way of doing it? Code from comment: static void Main() { List<double> Values = new List<double...

Bind arbitrary Python objects to CherryPy sessions

I'm using CherryPy to make a web-based frontend for SymPy that uses an asynchronous process library on the server side to allow for processing multiple requests at once without waiting for each one to complete. So as to allow for the frontend to function as expected, I am using one process for the entirety of each session. The client-s...