concurrent-processing

Getting a Chunk of Work

Recently I had to deal with a problem that I imagined would be pretty common: given a database table with a large (million+) number of rows to be processed, and various processors running in various machines / threads, how to safely allow each processor instance to get a chunk of work (say 100 items) without interfering with one another?...

Scala actors as single-threaded queues

I'd like to use actors in a program where I'll have some kind of restriction around treating some of the actors as if they were queues. For example, suppose I have some external system to which change events are applied and also some cache of the external system's data. So I have 2 actors: ChangeApplicationActor CacheActor As part of...

Preventing spamming of the functionality of a php page.

The background: Ok, I run a legacy BBG over at ninjawars.net. There is an "attack" that players can make on other players that is initialized via form post. Essentially, we can simplify the situation to pretend that there's a page, lets call it attack.php, with a giant "ATTACK" form post that submits to another php page, lets call it a...

Download multiple pages concurrently?

Hello I'd like to write a script in Python that can grab url's from a database, and download web pages concurrently to speed things instead of waiting for each page to download one after the other. According to this thread, Python doesn't allow this because of something called Global Interpreter Lock that prevents lauching the same scr...

Concurrent Programming Book for Unix in C

I'm looking for good books on concurrent programming in C in the Unix environment. They need to cover classic concurrency, Unix multi-processing, and POSIX thread. Most of the books I have found are not for C or Unix. Keep in mind that I am not expecting one book to cover all of that though it would be great if such a book existed. The ...

Request Queueing per IP or Limit One concurrent Request per IP in mod_rails Passenger or on Apache

Is there a way to queue up the requests by IP and process the requests in the same queue? I would like to achieve the following: Say IP1 is sending 20 requests per minute - I want all these requests to be processed in sequence on completion of the request1, then req2 and so on ... This should not effect other requests from other IPs. ...

Concurrent Threads in C# using BackgroundWorker

My C# application is such that a background worker is being used to wait for the acknowledgement of some transmitted data. Here is some psuedo code demonstrating what I'm trying to do: UI_thread { TransmitData() { // load data for tx // fire off TX background worker } RxSerialData() { // if received da...

Invalid Cross-Thread Operations from BackgroundWorker2_RunWorkerCompleted in C#

Hello. I'm getting an error that does not make sense. Cross-thread operation not valid: Control 'buttonOpenFile' accessed from a thread other than the thread it was created on. In my application, the UI thread fires off backgroundWorker1, which when almost complete fires off backgroundWorker2 and waits for it to complete. backgroundW...