Concurrency is a property of systems in which several processes are executing at the same time.

learn more… | top users | synonyms

5
votes
3answers
806 views

how to verify ConcurrentHashMap is threadsafe?

As the jdk doc said, ConcurrentHashMap is thread safe and it doesn't block multiple thread read. It is not necessary to doubt that since it was under many and restricted test. But I just curious how ...
5
votes
2answers
937 views

Can Clojure's thread-based agents handle c10k performance?

I'm writing a c10k-style service and am trying to evaluate Clojure's performance. Can Clojure agents handle this scale of concurrency with its thread-based agents? Other high performance systems ...
3
votes
2answers
135 views

Why should most logic be in the monitor objects and not in the thread objects when writing concurrent software in Java?

When I took the Realtime and Concurrent programming course our lecturer told us that when writing concurrent programs in Java and using monitors, most of the logic should be in the monitor and as ...
3
votes
2answers
373 views

I have data that sends in “bursts” of 100 records with a significant delay. How do I structure my classes for multithreading?

My datasource sends information in 100 batches of 100 records with a delay of 1 to 3 seconds between batches. I would like to start processing data as soon as it's received, but I'm not sure how to ...
1
vote
3answers
2k views

How can I multiprocess my program?

I wrote a program which scrape internet sites. It is pretty straigtforward because it process link one by one. With the limiting factor of the internet speed, the process is rather slow. I wonder, ...
2
votes
1answer
581 views

Can I implement the readers and writers algorithm in OpenMP by replacing counting semaphores with another feature?

After reading about OpenMP and not finding functions to support semaphores, I did an internet search for OpenMP and the readers and writers problem, but found no suitable matches. Is there a general ...
33
votes
7answers
2k views

Are there deprecated practices for multithread and multiprocessor programming that I should no longer use?

In the early days of FORTRAN and BASIC, essentially all programs were written with GOTO statements. The result was spaghetti code and the solution was structured programming. Similarly, pointers can ...
1
vote
2answers
1k views

How can we handle multiple instances of a method through a single class instance

How can we handle multiple instances of a method through a single class instance(Single constructor call)? To elaborate, I have a handler class which has two methods lets say verifyUser(String JSON) ...
8
votes
1answer
1k views

Conceptually what does it mean when it is said that each thread gets its own stack?

I have been reading Java Concurrency in Practice by Brian Goetz and inside the section Stack Confinement it is mentioned that each thread gets its own stack and so local variables are intrinsically ...
3
votes
1answer
179 views

How could one make a reasonably efficient, pointer-sized mutex?

I have my own ideas about how a pointer-sized mutex could be made: The integer is used as a set of flags, counter, index, and a spinlock that guards an entry in a table of pre-allocated kernel objects ...
5
votes
2answers
309 views

Good reasons for destroying mutexes with waiting threads

I'd like to see some valid examples of needing to let a thread enter a locked, non-re entrant mutex, then destroying the mutex (which supposedly terminates the thread). I can't think of any good ...
1
vote
1answer
656 views

Java BufferedReader vs Separate Producer consumer thread

I have a very big file delimited by some sequence of characters '*L*I*N*E'. The file will be of the order of 250G. And each line comes around 600bytes to 1000 bytes. I will be performing the following ...
1
vote
2answers
934 views

Performance of concurrent software on multicore processors [closed]

Recently I have often read that, since the trend is to build processors with multiple cores, it will be increasingly important to have programming languages that support concurrent and parallel ...
2
votes
1answer
90 views

concurrency semantics reading a file being written (ext)

In Ext 3/4 filesystem, if I have a log file open and being appended to, if another process tries to read it (e.g. with cat), what happens? Can the reading process read part of / an incomplete write? ...
7
votes
2answers
724 views

Parallelism implies concurrency but not the other way round right?

I often read that parallelism and concurrency are different things. Very often the answerers/commenters go as far as writing that they're two entirely different things. Yet in my view they're related ...
2
votes
3answers
255 views

What are the usual difficulties in concurrent programming and tuning of concurrent programs (shared-memory model)?

I can list part of the problems that will show up when writing a moderately-sized concurrent application with shared memory: Locking granularity Choice of synchronization primitive Number of threads ...
1
vote
2answers
545 views

How can I avoid concurrent access in PostgreSQL?

I would like to have your opinion, how I can handle the case when PDO engine and Hibernate engine "talk" to the same db? There is a PHP application as frontend, and a Java doing some job after user ...
8
votes
4answers
733 views

scalablity of Scala over Java

I read an article that says Scala handles concurrency better than Java. http://www.theserverside.com/feature/Solving-the-Scalability-Paradox-with-Scala-Clojure-and-Groovy ...the scalability ...
3
votes
1answer
222 views

Concurrency with listeners and upload: is this solution sound?

I'm working on an Android app. We have listeners for position data and camera capture which is timed on a background thread (not a service). The timer thread dictates when the image is captured ...
1
vote
1answer
606 views

Static objects and concurrency in a web application

I'm developing small Java Web Applications on Tomcat server and I'm using MySQL as my database. Up until now I was using a connection singleton for accessing the database but I found out that this ...
4
votes
8answers
531 views

When should I use parallelism? [closed]

After asking this question, I got to realize that parallelism may not always be good. So far I can see that parallelism (under c#) is A little complicated code-wise Will probably insert some ...
9
votes
5answers
5k views

Real world usage of DelayQueue

What would be a real world usage of DelayQueue, what common problem it was designed to solve?
3
votes
1answer
1k views

How to read from a database, and write to a file asynchronously / non blocking way in Java

I'm trying to modify a serial program that reads from a database, and writes results to a file, this is done in a blocking way and I think we can get performance boost of there is a memory buffer and ...
3
votes
2answers
384 views

How are you using CFThread in ColdFusion Applications? [closed]

I'm presenting on Concurrency in ColdFusion at CFObjective this year, and I'd like to hear how you're using CFThread in your ColdFusion applications. In addition, what problems have you had while ...
3
votes
3answers
204 views

Actor based concurrency and cancellation

I'm reading about actor based concurrency and I appreciate the simplicity of actors sequentially processing messages on a single thread. However there is one scenario that doesn't seen possible. ...
5
votes
3answers
774 views

How to avoid halting of the JVM due to a deadlock in java?

I have read many websites talking about how to avoid and how to design etc. I completely understand those strategies. My question is based on the following preconditions: You have a company with ...
6
votes
4answers
5k views

Problems of multiple threads sharing/accessing the same data [closed]

I have been researching into when data is being accessed or shared by multiple threads within Java. And looking into the problems such as: Thread Interference Memory Consistency Deadlock Starvation ...
13
votes
3answers
2k views

What are the best resources for learning about concurrency and multi-threaded applications?

I realised I have a massive knowledge gap when it comes to multi-threaded applications and concurrent programming. I've covered some basics in the past, but most of it seems to be gone from my mind, ...
4
votes
1answer
544 views

Selective mutual exclusion in Dining Philosophers and Readers and Writers problem

I've been reading about selective mutual exclusion (SME). The idea I got is that if a process competes for its resources against a subset of all the other process instead of competing with all the ...
6
votes
3answers
637 views

Rendezvous in Ada

In a test I was asked: What elements present in the general form of a rendezvous are not present in Ada language? I was a bit stumbled as I thought Ada fully supported rendezvous. Now it seems ...
7
votes
3answers
277 views

Optimistic work sharing on sparsely distributed systems

What would a system like BOINC look like if it were written today? At the time BOINC was written, databases were the primary choice for maintaining a shared state and concurrency among nodes. Since ...
1
vote
2answers
275 views

Are there any advantages of using separate RDBMS for reports?

My production database is SQL Server 2008 R2 Express. It has limited features and I am testing it in a production environment. To better handle reporting queries in a highly concurrent environment, I ...
2
votes
2answers
302 views

Concurrent Data Processing by Multiple People

Let's say I have a page, accessible by several people concurrently, that lists information that must be processed in some way by the user, after which it is either marked as "completed" and ...
7
votes
2answers
3k views

Looking for a distributed locking pattern

I need to come up with a custom recursive object locking mechanism\pattern for a distributed system in C#. Essentially, I have a multi-node system. Each node has exclusive write permissions over ...
2
votes
3answers
463 views

Sharing buffer between multiple threads part 2

This is a follow up to my previous not answered question, so I try to make it more clear: last question. I have a n-size buffer that is filled up from an external source, it has 2 main methods get() ...
2
votes
5answers
616 views

Programming language with native concurrency support for large graphs?

I'm currently looking for a new programming language to learn (currently working through some C++, know some C and Python), specifically one that has built-in concurrency support? I want to try to ...
17
votes
2answers
522 views

Why does shared state degrade performance?

I've been working under the share-nothing principle of concurrent programming. Essentially, all my worker threads have immutable read-only copies of the same state which is never shared between them ...
8
votes
2answers
884 views

Where should I start on a large concurrent programming assignment?

My task is to implement a distributed semaphore system (links to description) and an application for it. I will be using Java sockets, and it will use watermark arrays and priority queues (not sure ...
3
votes
1answer
247 views

What are the relative merits for implementing an Erlang-style “Continuation” pattern in C#

What are the relative merits (or demerits) for implementing an Erlang-style "Continuation" pattern in C#. I'm working on a project that has a large number of Lowest priority threads and I'm wondering ...
29
votes
16answers
7k views

Modern programming language with intuitive concurrent programming abstractions

I am interested in learning concurrent programming, focusing on the application/user level (not system programming). I am looking for a modern high level programming language that provides intuitive ...
14
votes
3answers
7k views

UML Diagrams of Multi-Threaded Applications

For single-threaded applications I like to use class diagrams to get an overview of the architecture of that application. This type of diagram, however, hasn’t been very helpful when trying to ...
18
votes
3answers
4k views

Why not Green Threads?

Whilst I know questions on this have been covered already (e.g. http://stackoverflow.com/questions/5713142/green-threads-vs-non-green-threads), I don't feel like I've got a satisfactory answer. The ...
4
votes
3answers
709 views

What are the recommended resources for learning about the Actor model of concurrent systems? [closed]

The Actor concurrency model is clearly gaining favor. Is there a good book that presents the patterns and pitfalls of the model? I am thinking about something that would discuss, for instance, the ...
17
votes
4answers
5k views

How does a movie theater seat booking system prevent multiple users from reserving the same seats?

In the movie theatre I go to they have ticket kiosks that allow you to select the seats you want; they also have a website that does the same (the website also has a countdown timer of like 30 secs in ...
10
votes
2answers
607 views

Is my description of the actor model right?

If I understood, the actor model is just like the object model, but with a few differences: EVERY object spawns it's own separate thread and its not a problem even when you have thousands of ...
2
votes
2answers
485 views

Are there any good Java/JVM libraries for my Expression Tree architecture? [closed]

My team and I are developing an enterprise-level application and I have devised an architecture for it that's best described as an "Expression Tree". The basic idea is that the leaf nodes of the tree ...
12
votes
8answers
2k views

Why should I know concurrent programming?

Concurrent programming is quite difficult to me: even looking at a basic slide seems challenging to me. It seems so abstract. What are the benefits to knowing Concurrent programming concepts well? ...
31
votes
5answers
8k views

Is object pooling a deprecated technique?

I am very familiar with the concept of object pooling and I always try to use it as much as possible. Additionally I always thought that object pooling is the standard norm as I have observed that ...
9
votes
6answers
601 views

Next in Concurrency

For past year I have been working a lot on concurrency in Java and have build and worked on many concurrent packages. So in terms of development in the concurrent world, I am quite confident. Further ...
1
vote
1answer
623 views

Model-View-Controller and client-side concurrency responsibility

In a web application that has a significant ajax component, where is the best place for the client-side concurrency responsibility to lie? We're trying to use MVC on both the server application (LAMP ...