I have at my disposal a REST service that accepts a JSON array of image urls, and will return scaled thumbnails.
Problem
I want to batch up image URLs sent by concurrent clients before calling the REST service.
Obviously if I receive 1 image, I should wait a moment in case other images trickle in.
I've settled on a batch of 5 images. ...
I am interested in defining a parallel map operator for my language. It transforms a list into a new list given an expression. It would have a syntax similar to a generator. Unlike generators in C# and Python, it would potentially be evaluated in parallel, if the compiler desires (e.g. there is an idle core, and the list is really big). ...
I have a list of n-bit "words"
type BitWord = [Bool]
and a trie which stores the word from the top to bottom:
data Tree = Bs Tree Tree -- Bs (zero_bit) (one_bit)
| X -- incomplete word
| B -- final bit of word
I have a function:
seenPreviously :: BitWord -> Tree -> (Tree,Bool)
The function steps through the ...
I have encountered a problem twice now whereby a producer thread produces N work items, submits them to an ExecutorService and then needs to wait until all N items have been processed.
Caveats
N is not known in advance. If it were I would simply create a CountDownLatch and then have producer thread await() until all work was complete...
Hello Im afraid about concurrency on partner application cause in the last days it was having troubles with CRUDS Operations, especially with inserts. So I ran SQL Profiler and note that his insert statement dont use transaction and also he is using :
INSERT INTO TABLEA VALUES ( (SELECT MAX(NUMBERFIELD) +1 FROM TABLEA), ....);
How avo...
hi we try to implement a process like when a user does something, his company's credit will be deducted accordingly.
But there is a concurrency issue when multiple users in one company participant in the process because the credit got deducted wrong.
Can anyone point a right direction for such issue?
thanks very much.
...
I was wondering if I'm supposed to stick to sqldatasources and objectdatasources to fill asp.net webcontrols and if programatically binding controls is a bad practice because you have to manually control concurrency. My main concern is if there is a good approach to control concurrency without the use of the sqldatasource and object dat...
How do I handdle concurrency in a Django model? I dont want the changes to the record being overwritten by another user who reads the same record
...
In Java, one would synchronize methods or blocks that access a shared resource that is needed in a multi-threaded environment.
I'm wondering how the "Scala Actors" way of doing this would work.
Suppose I have a connection pool of java.sql.Connection objects that I wish to provide thread-safe access to. I implement it as an actor that ...
Hello,
I can't seem to find anything equivalent to a Semaphore in the Blackberry Java Reference. What am I missing? java.util.concurrent isn't even there.
Thanks! Sean
...
Hi
We have developed one online examination in ASP.NET 3.5 and MySQL. The Operating System where the application is hosted is having Windows 2003 Server and IIS 6.0. For concurrent 50 users we are getting the following error.
'HTTP status-code verification point failed. Playback status-code '500' incompatible with test status-code '200...
It seems that Python standard library lacks various useful concurrency-related concepts such as atomic counter, executor and others that can be found in e.g. java.util.concurrent. Are there any external libraries that would provide easier building blocks for concurrent Python applications?
...
public class Test extends Thread{
public void hello(String s){
System.out.println(s);
}
public void run(){
hello("I’mrunning...");
}//endofrun()
public static void main(String [] args){
Test t=new Test();
System.out.println("always first");
t.start();
System.out.println("always second but...
public synchronized X getAnotherX(){
if(iterator.hasNext()){
X b = iterator.next();
String name = b.getInputFileName();
...
return b;
}
else{return null;}
}
despite the synchronized statement in the declaration header, i still get a ConcurrentModificationException Exception at the line where i use iterator.next(); w...
Is it advisable or even possible to have a dynamically growing array of structs fed and read by different concurrently running posix threads? Where do I have to look for best practices for applications of that sort - are there any which are "common wisdom"? I am new to this area and would need some initial pointers for where to start and...
How does one unit test that a new thread was spawned for a Runnable task when using an ExecutorService?
Basically, I have a static thread pool for my application.
public static final ExecutorService executorService = Executors.newCachedThreadPool();
I'd like to use this thread pool for the my unit tests, rather than mocking one out o...
I have an android client which will make Http connections to a server.
The server requires that all Http request provide a monotonically increasing counter in the Http header. e.g.
POST /foo/server
X-count: 43
Places that will initiate Http connections:
Inside activities under the user's command e.g. button clicks
Inside a Service ...
Normally (ie. not concurrently), putAll() cannot be more efficient than using lot's of calls to put(), even assuming that you exclude the cost of building the other Map that you pass to putAll(). That's because putAll() will need to iterate the passed Map's elements, as well as running through the algorithm for adding each key value pair...
Is it possible to run multiple stored procedures that run 'in the background'?
The stored procedures must be launched from a single, master stored procedure, in the same way that multiple worker threads are spawned. For example:
CREATE PROCEDURE MyLauncher
AS
BEGIN
BEGIN
@EXEC MyBackgroundSP01 -- Runs in parallel to the othe...
Suppose you had this:
def wipeProduct(hash, nameToDelete)
hash.each do |i|
key = i[0]
productName = i[1].first
hash.delete(key) if productName==nameToDelete
end
end
I'm not sure it's safe to delete things from a hash whilst you're iterating over the key-value pairs of the hash. I checked the RI documentation but I ha...