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

learn more… | top users | synonyms

1
vote
2answers
188 views

Are all race conditions worth fixing? [closed]

I just wrote the following piece of code (in delphi): procedure Update(Value: Integer); begin // If the last update was yesterday, replace yesterday value if CompareDate(FLastUpdate,Now) <> ...
17
votes
4answers
3k views

Programs that claim they are not “multi-core” friendly

You see this phrase or similar kicked around from time to time, generally referring to a program that claims they were not designed to take full advantage of multi-core processors. This is common ...
0
votes
3answers
440 views

Super Fast File Storage Engine

I basically have one big gigantic table (about 1.000.000.000.000 records) in a database with these fields: id, block_id, record id is unique, block_id is not unique, it contains about 10k (max) ...
12
votes
1answer
235 views

What intermediate representations can be used to reason about concurrency?

I am trying to better understand what would be required for a compiler to be able to make intelligent choices regarding concurrency on behalf of the programmer. I realize that there are many difficult ...
3
votes
1answer
462 views

Are go-langs goroutine pools just green threads?

The commentator here offers the following criticism of green threads: I was initially sold on the N:M model as a means of having event driven programming without the callback hell. You can write ...
0
votes
3answers
134 views

If mutual exclusion is not implemented, how would we detect a race condition?

Suppose we are in a distributed environment, and mutual exclusion is not implemented yet. So how would we be able to detect race conditions? When I researched, use of non-blocking algorithms was ...
0
votes
1answer
124 views

Does Clojure borrow concurrency ideas from Haskell?

In code quarterly interview with Rich Hickey Michael Fogus hints that Clojure borrows a lot from Haskell: Fogus: As someone who only knows Haskell enough to read the papers, Clojure appears to be ...
1
vote
1answer
196 views

Editing files without race conditions?

I have a CSV file that needs to be edited by multiple processes at the same time. My question is, how can I do this without introducing race conditions? It's easy to write to the end of the file ...
9
votes
2answers
936 views

SQLite with two python processes accessing it: one reading, one writing

I'm developing a small system with two components: one polls data from an internet resource and translates it into sql data to persist it locally; the second one reads that sql data from the local ...
9
votes
2answers
939 views

Is The Free Lunch Over? [closed]

In his famous The Free Lunch Is Over article from 2005, Herb Sutter predicted a Concurrent Programming Revolution as big as Object-Oriented Revolution. Has this revolution really happend in years 2005 ...
3
votes
1answer
253 views

What do goroutines, Ruby Fibers, etc. look like to the OS/Kernel?

In process concurrency and thread concurrency it's quite obvious how the kernel sees these as they map directly to real things that the kernel manages. When it comes to Golang goroutines and Ruby ...
1
vote
1answer
175 views

How do I find a good middle way to make this library safe for concurrent operations

I've made a little library called SignalR.EventAggregatorProxy Before I push it into 1.0 state I need to fix so it works safely with concurrent operations. Easiest way is lock all operations but ...
0
votes
1answer
216 views

Apple Dispatch Queue vs Threads

I've heard a lot about apple's famous dispatch queues and the GCD but today was the first time I decided to understand exactly what is going on, so I started reading Concurrency Programming Guide and ...
0
votes
1answer
152 views

Handling or preventing conflicts in a multi-user system

I have a web application that is accessed by multiple users from different locations worldwide. Let's say I have an "edit" form for a specific document and two (or more) users are editing the document ...
1
vote
2answers
252 views

C# Equivalent of Java Blocking Concurrent Collections [closed]

I am looking for equivalents of ArrayBlockingQueue, LinkedBlockingDeque, LinkedBlockingQueue, and PriorityBlockingQueue. Does C# have an equivalent. If not how can BlockingCollection (which seams to ...
7
votes
1answer
1k views

Erlang and Go concurrent programming, objective differences between CSP and Actors?

I was looking into concurrent programming in Erlang and Go programming languages. As per my finding they are used Actor model and CSP respectively. But still I am confused with what are the objective ...
6
votes
3answers
859 views

How many threads should access the file system at the same time?

We have a module in an application which stores data in multiple files and multilevel directories and access them from multiple threads (both reads and writes). The directory structure is based on a ...
8
votes
2answers
538 views

Uses of persistent data structures in non-functional languages

Languages that are purely functional or near-purely functional benefit from persistent data structures because they are immutable and fit well with the stateless style of functional programming. But ...
8
votes
2answers
512 views

Would Task-based programming in C++ require new language standard features?

So I saw this video on Youtube with all these C++ masters on GoingNative 2012 : Interactive panel where everybody could ask the questions. This is the video I was talking about: GoingNative 2012 - ...
5
votes
1answer
266 views

How can I benchmark concurrent key-value stores?

I have some concurrent key-value store implementations that are implemented with hash tables and search trees that I would like to compare. I would like to benchmark them with a real world application ...
11
votes
4answers
986 views

Functional Programming: right ideas about concurrency and state?

FP proponents have claimed that concurrency is easy because their paradigm avoids mutable state. I don't get it. Imagine we're creating a multiplayer dungeon crawl (a roguelike) using FP where we ...
0
votes
3answers
402 views

Multiple threads and single output source

For the sake of an exercise, say you have an input file with a series of lines of text with the objective of reversing their respective character sequences. Now introduce 5 threads that will each do ...
8
votes
4answers
4k views

The difference between “concurrent” and “parallel” execution?

What is the difference between the terms concurrent and parallel execution? I've never quite been able to grasp the distinction. The tag defines concurrency as a manner of running two processes ...
0
votes
2answers
175 views

How bad would it be to obtain a lock on every object?

Imagine a hypothetical programming environment that is largely like Java or .NET, i.e. object-oriented, garbage-collected, etc., but with one small change: Every time you call a method on an object, ...
18
votes
3answers
1k views

Why five dining philosophers?

I was wondering why the Dining philosophers problem is based on a five philosophers case. Why not four? I guess that we can observe all unpleasant issues that can occur when discussing five ...
4
votes
2answers
330 views

What is a good script language for writing server administration tasks? [closed]

I am administering hundreds of RHEL servers. There are many daily tasks to perform. Right now I am working with bash scripting and python. I was wondering if other languages such as Erlang, Lua, Ruby, ...
7
votes
1answer
336 views

In what meaningful ways does Erlang prevent race conditions in concurrent programming?

Reading about concurrency in Erlang, reminds me of the Akka concurrency toolkit. Both give you tools to prevent or limit race conditions. But you can send links to mutable data to other processes ...
5
votes
1answer
725 views

Common Lisp Implementations - threading and multiplatform?

I'm learning Common Lisp, mostly as a "mind gym" hobby thing, but I want to end up with a set of skills that would also be usable "in real life", because when you learn a language you also accumulate ...
1
vote
1answer
114 views

Design question about a concurrent forking server

I'm in the early stages of designing a client/server application. The clients will be batch programs that read a file of customer contact data (name, address, email address, phone no's) and pass ...
15
votes
3answers
3k views

Why is multithreading often preferred for improving performance?

I have a question, it's about why programmers seems to love concurrency and multi-threaded programs in general. I'm considering 2 main approaches here: an async approach basically based on signals, ...
11
votes
2answers
3k views

Are these advanced/unfair interview questions regarding Java concurrency? [closed]

Here are some questions I've recently asked interviewees who say they know Java concurrency: Explain the hazard of "memory visibility" - the way the JVM can reorder certain operations on variables ...
0
votes
1answer
207 views

Concurrency checking with Last Change Time

I have an app with the following three tables Email (emailNumber, Address) Recipients (reportNumber, emailNumber, lastChangeTime, status) Report (reportNumber, reportName) I have a C# application ...
2
votes
1answer
176 views

How to keep background requests in sequence

I'm faced with implementing interfaces for some rather archaic systems, for handling online deposits to stored value accounts (think campus card accounts for students). Here's my dilemma: stage 1 of ...
4
votes
2answers
346 views

Help me understand a part of Java Language Specification

I'm reading part 17.2.1 of Java language specification: http://docs.oracle.com/javase/specs/jls/se7/html/jls-17.html#jls-17.2.1 I won't copy a text, it's too long, but I would like to know, why for ...
1
vote
2answers
173 views

Requiring multithreading/concurrency for implementation of scripting language

Here's the deal: I'm looking at designing my own scripting/interpreted language for fun. I'm only in the planning stages right now; I want to make sure I have a very strong hold on exactly how I will ...
5
votes
3answers
696 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
831 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
127 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
301 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
1k 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
487 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 ...
32
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 ...
0
votes
2answers
741 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) ...
7
votes
1answer
818 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
175 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
285 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
590 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
813 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
620 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 ...