concurrency

WCF WS static Proxy concurrent calls, why it won't work?

I have found this example on http://www.codeproject.com/KB/WCF/WCFThrottling.aspx. My goal was to test multiple WS clients and i run into this issue. My question have two parts, 1) I am just curious why it's not possible to call one webmethod in parallel on one static ProxyObject (when I do it works but it behaves as if it would be cal...

internals of "Wait", "Pulse", "PulseAll"

Since there are no C# source codes for "Wait", "Pulse", "PulseAll" methods. Does anyone have their IL codes? if you know the internal data structrure that would be good. ...

Need a queue that can support multiple readers

I need a queue that can be processed by multiple readers. The readers will dequeue an element and send it to a REST service. What's important to note are: Each reader should be dequeueing different elements. If the queue has elements A, B & C, Thread 1 should dequeue A and Thread 2 should dequeue B in concurrent fashion. And so forth...

LinkedBlockingQueue vs ConcurrentLinkedQueue

My question relates to this question asked earlier. In situations where I am using a queue for communication between producer and consumer threads would people generally recommend using LinkedBlockingQueue or ConcurrentLinkedQueue? What are the advantages / disadvantages of using one over the other? The main difference I can see from ...

C# .net Concurrency Problems - SQL Connection then ADO.net changes

I have a c# .net program where I need to first insert data into a table using a sql connection and then adjust the same set of data using ADO.net. I am not sure how to make sure the insert via the sql connection is complete before doing the ado.net changes. I am getting a concurrency violation when I try the code below. I would guess ...

On FutureTask, finally and TimeoutExceptions in Java

I'm trying to understand how to ensure that a specific action completes in a certain amount of time. Seems like a simple job for java's new util.concurrent library. However, this task claims a connection to the database and I want to be sure that it properly releases that connection upon timeout. so to call the service: int resultCou...

How to synchronize access to ehcache, memcached & other key-value stores ?

From my understanding, each of these methods: get() and put() are atomic. But, when accessing caches like ehcache & memcached, in a CheckThenAct fashion, race conditions will arise. What should we synchronize on to ensure that if thread1 does a Get() and thread2 does a Get() followed by a Put(), that the first Get() will receive the ne...

Can I invoke XMPPConnection.sendPacket from concurrent threads ?

Motivation I want extra eyes to confirm that I am able to call this method XMPPConnection.sendPacket( Packet ) concurrently. For my current code, I am invoking a List of Callables (max 3) in a serial fashion. Each Callable sends/receives XMPP packets on the one piece of XMPPConnection. I plan to parallelize these Callables by spinning ...

Concurrent network client in Cocoa

I'm trying to work out in my head the best way to structure a Cocoa app that's essentially a concurrent download manager. There's a server the app talks to, the user makes a big list of things to pull down, and the app processes that list. (It's not using HTTP or FTP, so I can't use the URL-loading system; I'll be talking across socket c...

Testing performance of parallel programs on a single core machine

I would like to start playing with concurrency in the programs I write (mostly for fun), but I don't own a multi-core system and can't afford one any time soon. I run linux. Is there a way to, for example with a Virtual Machine, compare the performance of a multi-threaded implementation of a program with a single-threaded version, withou...

Data has always changed(SQL Server Management Studio)

Hi, I am using SQL Server Management studio and keep getting the same error, and the only way to get rid of it(usually) is to reset the SQL server(which is very annoying, and sometimes impossible from my remote machine) When I add a row to a table, and then I goto "Edit Top 200 Rows" it all displays and acts fine, and I go to a field I ...

Best Practise on Concurrency Issues in .Net Application

Hi, We are planning to upgrade an existing VB6 application to C# ( VS2008 ). ADO.Net follows more a disconnected strategy when accessing Data. I'm thinking about giving the Entity Framework a shot since using an ORM-tool is higly recommended if you want to speed up the development. And EF uses optimistic locking. How do you solve the a...

The canonical Java way to "resend-if-not-got-ACK"-scenario

As the topic depicts, I'm interested in the canonical java way to resend a message if the destination doesn't send an acknowledement message within a specific time frame. I could come up with a couple of alternatives, but im not sure i like them. E.g. (pseudo code/describition) start a new Thread and check some "external condition" if...

How would I do multiple concurrency in Scala, without the need for messages?

I understand that actors are a great feature and are the #1 choice for concurrency in scala, but I don't know if they would apply here. I am creating an asynchronous server. Clients connect, send data, the server does a cpu intensive task, and then the client disconnects. There is no waiting for data - as soon as the client connects, it...

boost scoped_lock. Will this lock?

solved I changed the bfs::directory_iterator Queue to a std::string queue, and surprisingly solved the problem. Hi, I have a gut feeling that i'm doing things wrong. I've implemented (or attempted to) the thread pool pattern. N threads read from a Queue, but i'm having some trouble. Here's what i got: //inside a while loop bool isE...

AtomicInteger lazySet and set

May I know what is the difference among lazySet and set method for AtomicInteger. javadoc doesn't talk much about lazySet : Eventually sets to the given value. It seems that AtomicInteger will not immediately be set to the desired value, but it will be scheduled to be set in some time. But, what is the practical use of this method? Any...

DB design/latency/concurrency, awful headache

I have a client-server application which gets all the data out of a couple of tables, recalculates something and stores it. Example: Each Item has a 'Bill of Materials' = the list and quantities of which other items it is made out of. Therefore the cost of an item is the sum of the cost of the items in its BOM * their quantities. Ultim...

Locking strategy with PropertyChangeListener

I've defined a class with a number of "observable" properties. Internally the class contains a single thread that performs I/O; e.g. public class Foo { private final PropertyChangeSupport support; private State state; public Foo() { this.support = new PropertyChangeSupport(this); } public synchronized State getState() { retur...

How do you configure WorkManagers in WebLogic 10.3?

I would like to use a WorkManager to schedule some parallel jobs on a WebLogic 10.3 app server. http://java.sun.com/javaee/5/docs/api/javax/resource/spi/work/WorkManager.html I'm finding the Oracle/BEA documentation a bit fragmented and hard to follow and it does not have good examples for using WorkManagers from EJB 3.0. Specifically...

Performance of concurrency in Django (apache2 prefork/mod_wsgi), what am I doing wrong?

First of all I am not in any way unhappy with the performance of my Django powered site, its not getting massive traffic, a bit over 1000 visits per day so far. I was curious how well it would cope with heavy traffic peaks so I used the ab-tool to do some benchmarking. I noticed that the performance when the concurrency is larger than ...