Consider this:
@interface SomeViewController : UIViewController {
SomeChildObject *child;
}
@end
@implementation SomeViewController
- (void) viewDidLoad {
...
child.delegate = self;
}
- (void) somethingHappened {
NSInvocationOperation *operation = [[NSInvocationOperation alloc]
initWithTarget:child
sel...
I'm looking at the static method
Collections.synchronizedList(List<T> list)
Javadoc says
It is imperative that the user manually synchronize on the returned list when iterating over it...
What's the purpose of creating a synchronized list if I still have to manually synchronize it?
...
Consider a LOB site, where users work on a large shared dataset.
Using Wcf Data Services on the server side and the DataContext and DataView from the AJAX 4.0 client library on the client side to enable CRUD operations.
Getting the data on the initial load is straight forward, just query the server and display the data (in a table for e...
Hi, I 'm having a problem with WCF callbacks that's a proper head-scratcher...
Description of setup:
There's an interface IService that defines a WCF service. My server app implements that service in class ServiceImplementation. The service also has a callback, defined in IServiceCallback and implemented in the client app in class Call...
I've got a C++ project which uses automake and autoconf. I'm new to both of these.
My home directory is network mounted -- the same on every server we have -- and I want to compile and run the project (and its executable) concurrently on separate machines.
Our servers are frequently different architectures. My desktop is 32-bit, but th...
I have a class called Root which serves as some kind of phonebook for dynamic method calls: it holds a dictionary of url keys pointing to objects. When a command wants to execute a given method it calls a Root instance with an url and some parameter:
root_->call("/some/url", ...);
Actually, the call method in Root looks close to this:...
Hi,
Say I have the following table:
ID|Read
-------
1|true
2|false
3|false
4|false
... and I need to read the smallest ID, that has [Read] == false; plus, update that I have now read it.
So if i execute my Stored Procedure dbo.getMinID, it will return ID: 2, and update [Read] -> true.
CREATE PROCEDURE [dbo].[getMinID]
(
@Quer...
I need to generate a result from 2 XMLHttpRequests.
How can I make the requests concurrently and wait for them to both finish?
I've though of something like...
resp1="";
req1.onreadystatechange=function(){if(this.readyState=4)resp1==this.responseText;}
req2.onreadystatechangefunction(){if(this.readyState=4) finish(this.responseText);}
...
Here some C++ code that is accessed from multiple threads in parallel. It has a critical section:
lock.Acquire();
current_id = shared_id;
// small amounts of other code
shared_id = (shared_id + 1) % max_id;
lock.Release();
// do something with current_id
The class of the lock variable is wrapper around the POSIX mutex implementation. ...
hi
has anyone implemented design patterns for concurrent programming. If so did you have any implementation issues/difficulties??
Thanks
~Sanjay
...
This is a question regarding coding design, so please forgive the long code listings: I could not resume these ideas and the potential pitfalls without showing the actual code.
I am writing a ConcurrentReferenceCounted class and would appreciate some feedback on my implementation. Sub-classes from this class will receive "release" inste...
Hello
I have dynamic array of hashtables
Can I use synchronized for each of them separately?
Like synchronized(array[1]) { code .. }, synchronized(array[2]) { code .. }
Thanks
...
Hi,
What approach(es) would you recommend regarding a WinForms application that will have both the user interface & a scheduling components regarding sharing configuration data from the database? (exposed in the program via DataTable) Assume both the scheduled task and the user interface can make updates to the shared data. Also ass...
I am an open source developer, and I need to write a highly-scalable web service. For a variety of reasons (basically poor support for concurrency), I am using Ruby on Rails for my app front-end but not for the back-end (read: http://www.ddj.com/go-parallel/article/showArticle.jhtml?articleID=212903282). My web service will need to call ...
require 'net/http'
urls = [
{'link' => 'http://www.google.com/'},
{'link' => 'http://www.yandex.ru/'},
{'link' => 'http://www.baidu.com/'}
]
urls.each do |u|
u['content'] = Net::HTTP.get( URI.parse(u['link']) )
end
print urls
This code works in synchronous style. First request, second, third. I would like to send all requests...
The usual pattern for a ReadWriteMutex is to use a semaphore and have the writer loop to acquire all the resources:
inline void write_lock() {
ScopedLock lock(acquire_mutex_);
for (size_t i=0; i < resource_count_; ++i) {
if (sem_wait(semaphore_) < 0) {
fprintf(stderr, "Could not acquire semaphore (%s)\n", strerror(errno));...
As I understood fork() creates a child process by copying the image of the parent process.
My question is about how do child and parent processes share the stdout stream?
Can printf() function of one process be interrupted by other or not?
Which may cause the mixed output.
Or is the printf() function output atomic?
For example:
The...
Hello ,
In my doPost method of the servlet I need to access a file (shared resource ) and update the file .
How do I cater to some 100 users using this at the same time ?
Regards,
Mithun
...
Can several threads operate on the same socket descriptor, i.e accept(sock_fd) at the same time without concern?
The platform I'm mostly interested in is POSIX/Linux.
...
I need to select first (let's say) 10000 rows in database and return them. There may be more clients that do this operation at one time. I came up with this query:
update v set v.batch_Id = :batchId
from tblRedir v
inner join (
select top 10000 id
from tblRedir
where batch_Id is null
...