I'm writing a project at the moment that involves running two parallel threads to pull data from different sources at regular intervals. I am using the Threads functionality in ruby 1.9 to do this but am unfortunately running up against deadlock problems. Also I have a feeling that the Thread.join method is causing the threads to queue r...
In a "serious" Java GUI app, you'll have models behind many of your GUI elements: A DocumentModel backing a JEditorPane, for example, or a ListModel behind a JList.
We're always told not to make GUI changes from outside the Swing worker thread and given SwingUtilities.invoke...() for working around that. Fine, I can live with that! It's...
I'm getting a ChangeConflictException in my web application when the code updates a certain row within a certain table. The best I can tell it seems as though two users are completing the transaction at the same exact time and optimistic concurrency only affect the SubmitChanges() method instead of doing the lock when the row is selected...
JSR-133 FAQ says:
But there is more to synchronization
than mutual exclusion. Synchronization
ensures that memory writes by a thread
before or during a synchronized block
are made visible in a predictable
manner to other threads which
synchronize on the same monitor. After
we exit a synchronized block, we
release the ...
The title sounds like there is a lot of problems ahead. Here's my specific case:
This is a travel tickets sales system. Each route has a limited quantity of tickets, and so purchasing the last ticket for a given route shouldn't be accessible to two people (a standard scenario). However, there is the "return ticket" option.. So, I'm usin...
Correct me if I'm wrong, but I'm surprised this hasn't been asked before on here ...
...
There has been a significant shift towards data-parallel programming via systems like OpenCL and CUDA over the last few years, and yet books published even within the last six months never even mention the topic of data-parallel programming.
It's not suitable for every problem, but it seems that there is a significant gap here that isn'...
stackless python didn't take a good usage of multi-core, so where is the point it should be faster than python thread/multiprocessing ?
all the benchmark use stackless python tasklet to compare with python thread lock and queue, that's unfair, cause lock always has low efficiency
see, if use single thread function call without lock i...
I've had the need for a multi-threaded data structure that supports these claims:
Allows multiple concurrent readers and writers
Is sorted
Is easy to reason about
Fulfilling multiple readers and one writer is a lot easier, but I really would wan't to allow multiple writers.
I've been doing research into this area, and I'm aware of ...
Heya,
I'm doing to preface this with the fact I'm a relative Java/Scala newbie so I wouldn't rule out that there is something obvious I'm not doing.
I've got a Scala application which connects via Hibernate to a MySQL database. The Application is designed to process a large amount of data, about 2,750,000 records so I've tried to optim...
Also, if not python or java, then would you more generally pick a statically-typed language or a dynamic-type language?
...
Briefly, a manual reset event is a synchronization construct which is either in the "signaled" or "nonsignaled" state. In the signaled state, any thread which calls a wait function on the event will not block and execution will continue unaffected. Any and all threads which calls a wait function on a nonsignaled object will block until...
Say you have the following class
public class AccessStatistics {
private final int noPages, noErrors;
public AccessStatistics(int noPages, int noErrors) {
this.noPages = noPages;
this.noErrors = noErrors;
}
public int getNoPages() { return noPages; }
public int getNoErrors() { return noErrors; }
}
and you execute the...
I am currently developing an application for Azure Table Storage. In that application I have table which will have relatively few inserts (a couple of thousand/day) and the primary key of these entities will be used in another table, which will have billions of rows.
Therefore I am looking for a way to use an auto-incremented integer, ...
The Jobs API in Eclipse RCP apparently works much differently than I expected. I thought that creating and scheduling multiple Jobs would actually cause multiple worker threads to be created, executing the Jobs in parallel unless there was an ISchedulingRule conflict.
I went back and read the documentation more closely, and also discove...
I have many C# books that all have one small section on Threads and maybe another on Delegates and Lamdas, however, I can't seem to find a book where the primary focus is Concurrency. Can anyone recommend a book on using Concurrency when writing C#.net apps?
I have found several books on Concurrency principles, but I need actual code s...
Here is my use case, I have an object that is logically equal to my HashMap key but not the same object (not ==). I need to get the actuall key object out of the HashMap so that i can synchronise on it. I am aware that i can iterate over the ketSet, but this is slow in comparison to hashing.
Looking through the java.util.HashMap impleme...
let's say i want to implement a distributed database (each node being the replica of the others); i hear that cdb is able to easily sync between two nodes and at least support some form of conflict resolution.
unfortunately i don't know couchdb therefore i have to ask: how's the situation for a "graph" of nodes? let's say we have a thou...
I am writing an audit file that is writing the username, time, and the old/changed values of several variables in the application for each user when they use my application. It is using a FileStream and StreamWriter to access the audit file. All audits for each user will be written to the same file.
The issue is that when two users ...
I have been working with the example code from the ExecutorCompletionService and put together the following example code. The code in solve() works as expected and prints
1
2
3
4
5
The code in solve2() doesn't print anything and in fact never exits. It doesn't matter whether ecs is constructed before or after submitting the jobs to th...