Problem Description:
Write a thing like that like twitter engine to access twitter api. Now I is designed such that:
twitter engine inside all network access methods are synchronized. Then global shared a single case engine. Then concurrent access to the network at all viewController in:
dispatch_async (.....
{
...
[Engine getUser];
....
});
The engine is a function of a number of network access package itself is not a member variable.
Concurrent will not produce such problems? Will the N viewcontroller same engine in an asynchronous call method will block or any other questions?
Reply:
Why the N viewController simultaneous calls, whether you design a logical problem? Conversely, if there are concurrent, there will be problems with semaphore synchronization look good.
Reply:
The so-called "N a viewcontroller" while calling means that after a viewcontroller call load has not been completed, the user switches to another viewcontroller, and perform a new load. This time will be "concurrent" it? Or the engine itself started serial execution?
Reply:
No comments:
Post a Comment