concurrency

Global Temporary Table Concurrency

Hi, I have a global temp table which is set as delete on commit. How does it behave on concurrency issue? I mean what happens if another session wants to use that global temporary table? The answer will probably not be "they share the same data". Now, if my guess is correct :), is the table locked until the first connection commits, o...

Java - Thread safety of ArrayList constructors

I am looking at this piece of code. This constructor delegates to the native method "System.arraycopy" Is it Thread safe? And by that I mean can it ever throw a ConcurrentModificationException? public Collection<Object> getConnections(Collection<Object> someCollection) { return new ArrayList<Object>(someCollection); } Does it mak...

Concurrency violation: the DeleteCommand affected 0 of the expected 1 records.

I'm building a software that uses an access database connect by the Vb.net 2008 data connection wizard... i wish to perform basic navigations....all i need is a standard insert, update and delete commands that would allow me save and delete records without throwing any "Concurrency violation: the DeleteCommand affected 0 of the expected ...

CherryPy and concurrency

Hi folks, I'm using CherryPy in order to serve a python application through WSGI. I tried benchmarking it, but it seems as if CherryPy can only handle exactly 10 req/sec. No matter what I do. Built a simple app with a 3 second pause, in order to accurately determine what is going on... and I can confirm that the 10 req/sec has nothing...

Is it safe to spin on a volatile variable in user-mode threads?

I'm not quite sure if it's safe to spin on a volatile variable in user-mode threads, to implement a light-weight spin_lock, I looked at the tbb source code, tbb_machine.h:170, //! Spin WHILE the value of the variable is equal to a given value /** T and U should be comparable types. */ template<typename T, typename U> void spin_wait_whi...

Java - Multithreading !

What does phrase "synchronization with main memory" mean? ...

Best (or appropriate) WSGI server for this Python script? - Python

Hi folks, I'm having quite a problem deciding how to serve a few Python scripts. The problem is that the basic functionality could be generalized by this: do_something() time.sleep(3) do_something() I tried various WSGI servers, but they have all been giving me concurrency limitations, as in I have to specify how many threads to u...

Nested lock to the same object performance

Hi Is it a performace cost to use a nested locks to the same object. Say we have: public void AddRange(IEnumeratable<Item> items) { lock (_syncObject) { foreach (Item item in items) { InsertItem(item); } } } public void InsertItem(Item item) ...

How does volatile actually work?

Marking a variable as volatile in Java ensures that every thread sees the value that was last written to it instead of some stale value. I was wondering how this is actually achieved. Does the JVM emit special instructions that flush the CPU cashes or something? ...

Are LinkedBlockingQueue's insert and remove methods thread safe?

I'm using LinkedBlockingQueue between two different threads. One thread adds data via add, while the other thread receives data via take. My question is, do I need to synchronize access to add and take. Is LinkedBlockingQueue's insert and remove methods thread safe? ...

Urllib and concurrency - Python

Hi there, I'm serving a python script through WSGI. The script accesses a web resource through urllib, computes the resource and then returns a value. Problem is that urllib doesn't seem to handle many concurrent requests to a precise URL. As soon as the requests go up to 30 concurrent request, the requests slow to a crawl! :( Help...

Java - Multithreading !

If a thread holds a lock , what happens when the thread needs to enter another critical section controlled by the same lock? ...

Why servlet halt a moment in concurrent request.

I use Axis for webservice service. when more than 8 concurrent , there are some request halt randomly for about 30 seconds. I debug by log in every line and found from my code: public class foo{ void bar(){ a(); log.debug('exit from a'); } void a(){ log.debug('exit a'); } th...

Is lock returned by ReentrantReadWriteLock equivalent to it's read and write locks?

Hello, I have been looking around for the answer to this, but no joy. In Java, is using the lock created by ReentrantReadWriteLock equivalent to getting the read and write locks as returned by readLock.lock() and writeLock.lock()? In other words, can I expect the read and write locks associated with the ReentrantReadWriteLock to be re...

Suggest a open source project which heavily uses java concurrency utilities?

I have done good amount of Java programming, but yet to master Threading & Concurrency. I would like to become an expert programmer in threading & concurrency. I have also took a short at Tomcat code, I was able to understand, but looking even more complex project. Could you suggest any open source project which heavily uses java threa...

Recursive Locking in Java

Hi there Can anyone explain what is meant by recursive locking in Java? Many thanks ...

Synchronized method in Java

I have a question. In the following code, if a thread were blocked at wait statement, and another thread attempts to execute foo(), would the hello world message be printed? and Why? synchronized foo(){ system.out.println("hello world"); ..... wait(); ..... } ...

Concurrent web requests with Ruby (Sinatra?)?

I have a Sinatra app that basically takes some input values and then finds data matching those values from external services like Flickr, Twitter, etc. For example: input:"Chattanooga Choo Choo" Would go out and find images at Flickr on the Chattanooga Choo Choo and tweets from Twitter, etc. Right now I have something like: @images =...

Start and run a class member function in background, in QT/C++

Once a minute I want to run a task, not blocking other GUI functions. I heared somthing about QConcurent::run ... Or should I use signals and slots? ...

Concurrent threads adding to ArrayList at same time - what happens?

We have multiple threads calling add(obj) on an ArrayList. My theory is that when add is called concurrently by two threads, that only one of the two objects being added is really added to the ArrayList. Is this plausable? If so, how do you get around this? Use a synchronized collection like Vector? ...