I programmed a simple WCF service that stores messages sent by users and sends these messages to the intended user when asked for. For now, the persistence is implemented by creating username.xml files with the following structure:
<messages recipient="username">
<message sender="otheruser">
...
</message
</messages>
It is po...
new Timer(...).schedule(task)
Is task guaranteed to be run by a single thread at any given time?
...
When developing an application which consumes an external webservice I have generated the sources from the wsdl-url and then created a client:
GeoIPServiceClient service = new GeoIPServiceClient();
GeoIPServiceSoap geoIPClient = service.getGeoIPServiceSoap();
Since the creation of this proxy takes some time I set the client as an at...
Which book or books would you recommend for learning the ins and outs of Java 5's Concurrency and most importantly why?
What I'm looking for exactly is a book which especially goes through the Java 5's new concurrency mechanisms (i.e. java.util.concurrent package) and could also be used to learn most of what there is to learn about conc...
I'm looking for a concurrency object that can assist in the following use case:
threads/entities: 1 publisher (unique), 0-many readers
publisher frequently / erratically updates a data structure, needs to do so quickly and with minimal latency
each reader has read access to the data structure (either through something that doesn't allo...
Hi, I've got a simple mdb database set up in Visual Basic Express Edition (winforms) and I'm trying to update data from a datagridview to a database. I've databinded the textboxes to the columns I want in the datagridview and this works great.
After some struggling, I've finally managed to have the values updated in every row of the da...
I need to execute some amount of tasks 4 at a time, something like this:
ExecutorService taskExecutor = Executors.newFixedThreadPool(4);
while(...) {
taskExecutor.execute(new MyTask());
}
//...wait for completion somehow
How can I get notified once all of them are complete? For now I can't think about anything better than setting ...
Given I invoke an actor from inside react does this block the calling Actor or is it still processing other requests?
class worker extends Actor()
{
def act() = {
loop {
react {
msg =>
var foo = another_actor !? 'bar' //Block here?
println(foo)
}
}
}
...
Does java.util.concurrent.atomic.AtomicBoolean not have a method that can atomically negate/invert the value? Can I do it another way? Am I missing something?
...
We're currently writing an application for which IT has already purchased hardware for. Their approach was to buy big hardware on which we would deploy. In order to add more processing, they plan on adding additional servers with identical software. In order to accomodate this design, we are using Terracotta to provide the ability to run...
In my program i have some very long task, which should be interruptable from GUI (WPF). Any advices about threading architecture?
This task looks like N thread with such code:
public void DoLongOperation()
{
for(int i=beginPoint; i<endPoint; i++)
{
doSomethingStupid(dataArray[i]);
}
}
...
Suppose I have these two tables:
Invoice
-------
iInvoiceID int PK not null
dtCompleted datetime null
InvoiceItem
-----------
iInvoiceItemID int PK not null
iInvoiceID int FK (Invoice.iInvoiceID) not null
dtCompleted datetime null
Each InvoiceItem might be fulfilled by a different process (executable) that runs on a different machine...
If I have a class that implements the Runnable interface, what are the differences between these statements in the main method?
MyThread t1 = new MyThread();
t1.start();
and
MyThread t2 = new MyThread();
new Thread(t2).start();
...
I have two threads running from a controller class. The first thread receives SMS messages and should continue running as long as the program is in the started state. The other thread is used to calculate the units GPS location.
The controller launches the SMS thread and waits from a text message. If a text message meets certain criteri...
I'm having an issue with memcached. Not sure if it's memcached, php, or tcp sockets but everytime I try a benchmark with 50 or more concurrency to a page with memcached, some of those request failed using apache ab. I get the (99) Cannot assign requested address error.
When I do a concurrency test of 5000 to a regular phpinfo() page. Ev...
I have recently read about how cursors should be avoided. Well, I would like to know if my usage of them is appropriate.
I am creating a scripting engine that will work online(embedded in a page, server-side) This scripting engine will be used by "advanced" end users of this product. The product works very heavily with the database howe...
From javadoc:
A ConcurrentLinkedQueue is an appropriate choice when many threads will share access to a common collection. This queue does not permit null elements.
ArrayBlockingQueue is a classic "bounded buffer", in which a fixed-sized array holds elements inserted by producers and extracted by consumers. This class supports an optio...
By "concurrency" I mean lightweight processes like Erlang's actors and concurrent GC aimed to make such a processes work smoothly.
It would be very cool if INRIA got rid of those drawbacks of the current OCaml implementation to make OCaml more prepared for the multicore future.
P.S. F# isn't what I'm looking for.
...
A Perl script (which I do not control) appends lines to the end of a text file periodically.
I need my PHP script (which will run as a cron job) to read the lines from that file, process them, and then remove them from the file. But, it seems like the only way to remove a line from a file with PHP is to read the file into a variable, re...
A little presentation for what I want to do:
Consider the case where different people from a firm get, once a year, an all expenses paid trip to somewhere. There may be 1000 persons that could qualify for the trip but only 16 places are available.
Each of this 16 spots has an associated index which must be from 1 to 16. The ones on th...