WEB开发网
开发学院手机开发Android 开发 Android 开发基础 Thread-safe methods 阅读

Android 开发基础 Thread-safe methods

 2010-07-15 21:18:00 来源:WEB开发网   
核心提示:subclass that implements RPC methods) would be called from threads in the pool. Since services can have more than one client, more than one pool thread can enga
subclass that implements RPC methods) would be called from threads in the pool. Since services can have more than one client, more than one pool thread can engage the same IBinder method at the same time. IBinder methods must, therefore, be implemented to be thread-safe.

Similarly, a content provider can receive data requests that originate in other processes. Although the ContentResolver and ContentProvider classes hide the details of how the interprocess communication is managed, ContentProvider methods that respond to those requests — the methods query(), insert(), delete(), update(), and getType() — are called from a pool of threads in the content provider’s process, not the main thread of the process. Since these methods may be called from any number of threads at the same time, they too must be implemented to be thread-safe.

上一页  1 2 

Tags:Android 开发 基础

编辑录入:coldstar [复制链接] [打 印]
赞助商链接