ios - understanding sync and asyn operations -
ios - understanding sync and asyn operations -
i learning how create sync , asyn operations . please right me have mentioned/learned right:
sync , asyn operations can done in next ways(we can pick according our requirement)
gcd nsthread nsoperationqueue-adding nsoperation2 . gcd c api , on top of - nsthread , nsoperationqueue,nsoperation written
3 . nsoperation nil thread has number of tasks within . same main() thread . if written creating thread means creating custom nsoperation
4 . nsconnectionurl,afnetwork on top of these gcd,nsthread,nsoperationqueue,nsoperation
please find inline response below.
1) sync , asyn operations can done in next ways(we can pick according our requirement)
gcd nsthread nsoperationqueue-adding nsoperation
your understanding correct, except modification , adding more info nsoperatonqueue.
even if implementation of custom operation synchronous, adding operation queue, converts asynchronous operation.
and if custom operation implemented in synchronous way, calling start method works in synchronous way - uses current thread execute own task.
2 . gcd c api , on top of - nsthread , nsoperationqueue,nsoperation written
according understanding, nsoperaton implemented on top of gcd, not nsthread.3 . nsoperation nil thread has number of tasks within . same main() thread . if written creating thread means creating custom nsoperation
the custom operation either perform tasks in own thread or in separate thread. differs implementation custom operation.
a) custom operation implemented in synchronous manner i.e not creating thread in start method phone call main method. executes operation tasks in current thread operation start method called.
but, same synchronous custom operation, adding operation queue, executes tasks in separate thread. separate thread created operation queue.
b) custom operation implemented in asynchronous manner, i.e execute tasks in separate thread.
4 . nsconnectionurl,afnetwork on top of these gcd,nsthread,nsoperationqueue,nsoperation
don't have idea. ios iphone multithreading nsthread nsoperationqueue
Comments
Post a Comment