concurrency

Converting sequential Java to concurrent java code

Hi Everybody, I am planning to do a project in Java in which I want to transform a sequential Java code to a concurrent Java code and measure the efficiency .Any suggestions on which free source java application would be best for my project.Any other suggestions on how to go about it? Thanks in advance Deed ...

Lock, mutex, semaphore... what's the difference?

I've heard these words related to concurrent programming, but what's the difference between them? ...

ScheduledThreadPoolExecutor and corePoolSize 0?

I'd like to have a ScheduledThreadPoolExecutor which also stops the last thread if there is no work to do, and creates (and keeps threads alive for some time) if there are new tasks. But once there is no more work to do, it should again discard all threads. I naivly created it as new ScheduledThreadPoolExecutor(0) but as a consequence, ...

Can i get any advantage from Athlon 64 3800 writing a concurrent program on Ada?

I'm limited to ObjectAda 7.2 for particular reason. Do i need to install a 64 bit OS (Win 64x in my case) to write and run such programs? ...

Haskell as a highly concurrent server

Let's say I want to write a server in Haskell. The kind that has high concurrency and simple processing. The kind that would be robust to failures and offer high availability. The kind that Erlang would be good for. What would be a good set of tools, whether a framework or a set of primitives, to start from? ...

Synchronization of a Queue

I've been reading up on Doug Lea's 'Concurrency Programming in Java' book. As you may know, Doug originally wrote the Java Concurrency API. However, something has caused me some confusion and I was hoping to gain a few my opinions on this little conundrum! Take the following code from Doug Lea's queuing example... class LinkedQueue { ...

Tomcat - Asynchronous HTTP Calls Super Slow vs. Jetty

We have a java-based web application that makes a couple bursts of asynchronous http calls to web services & api's. Using a default Jetty configuration, the application takes roughly 4 seconds to complete. The same operation in Tomcat is taking over a minute. A slew of configuration changes for Tomcat have been attempted, but nothing se...

Are C# structs thread safe?

Is a C# struct thread-safe? For example if there is a: struct Data { int _number; public int Number { get { return _number; } set { _number = value; } } public Data(int number) { _number = number; } } in another type: class DadData { public Data TheData { get; set; } } is property named TheData, thread-safe? ...

How can manage many user requests to an apache web server using win32com in python?

Hello every body, I work on a Web text-to-speech System, trasforming text documents in audio mp3 files, using python 2.5. I use Apache2.2 as a server and mod_python as module to embed the Python interpreter within the server. The user should submit via web interface (input interface), a file txt or a Word document (.doc or .rtf) and th...

C++ concurrent associative containers?

I'm looking for a associative container of some sort that provides safe concurrent read & write access provided you're never simultaneously reading and writing the same element. Basically I have this setup: Thread 1: Create A, Write A to container, Send A over the network. Thread 2: Receive response to A, Read A from container, do som...

Solving embarassingly parallel problems using Python multiprocessing

How does one use multiprocessing to tackle embarrassingly parallel problems? Embarassingly parallel problems typically consist of three basic parts: Read input data (from a file, database, tcp connection, etc.). Run calculations on the input data, where each calculation is independent of any other calculation. Write results of calcula...

How to connect signals into complex circuits in .NET?

For some concurrent code, I want to connect a bunch of signals together like a circuit. In .NET we can do a WaitAll or WaitAny on a collection of signals. I want to do something like this: WaitAny ( WaitAll (c1, c2), WaitAll (c3, c4) ) ; Unfortunately, the library doesn't support composing these operations into more complex trees. My ...

How to add a spinner to the view before doing a computationally intense task

I have a UITableViewController and when I push a particular view onto the stack it takes forever so I wanted to add a spinner to the cell before moving along. The problem I'm having is that the spinner gets added after the new view gets pushed onto the controller stack. But I thought that messages were synchronous? So how can I make thi...

Concurrent downloads - Python

Hi folks, the plan is this: I download a webpage, collect a list of images parsed in the DOM and then download these. After this I would iterate through the images in order to evaluate which image is best suited to represent the webpage. Problem is that images are downloaded 1 by 1 and this can take quite some time. It would be gre...

Concurrent appends to the same file using Perl

I have a need to upgrade a Perl CGI script where the users must complete 3 steps. After they finish each step, the script is logging which step the user completed. Having a record of this is important so we can prove to the user that they only finished step one and didn't complete all three steps, for example. Right now, the script is...

Ordering concurrent tasks to minimise waiting

In a system with multiple concurrent tasks operating on data, I want to order the tasks such that there is a minimum amount of waiting time involved. Each task in the system uses a certain set of resources, tasks are issued in a certain order (this order is what I want to calculate), a task will not start until it can get a lock on all r...

How is thread synchronization implemented, at the assembly language level?

While I'm familiar with concurrent programming concepts such as mutexes and semaphores, I have never understood how they are implemented at the assembly language level. I imagine there being a set of memory "flags" saying: lock A is held by thread 1 lock B is held by thread 3 lock C is not held by any thread etc But how is access to...

at most n users in distributed concurrency control

Is it possible to implement at most n users based on majority voting, or voting district by Maekawa? "At most n users" here means n users can access the resource at the same time. I think both of them are not possible, as there's always a case that can violate the rule. ...

Elect one web application instance to perform a task triggered by an external event?

I have an ASP.NET application running on multiple IIS6 web servers, with a SQL Server 2005 database back-end. I need to: monitor the database for the completion of an external job event, and then have exactly one web application instance submit some information to a web service For (1) it seems like a SqlDependency would be the best...

Concurrency Violation in NHibernate( c#) example

For quite some time , I was reading about the optimistic concurrency in NHibernate. If what i understood was correct then the below sample should hold good. Consider two transactions T1 and T2. When T1 and T2 are done simultaneously , the state(DB entries) gets updated with the values of the most latest update.(T1 or T2). Though it ...