开发者

NsThread list task

开发者 https://www.devze.com 2023-03-06 12:48 出处:网络
Hello everyone I need to accomplish this (iphone/objective-c) : I have my thread it has to pe开发者_JAVA技巧rform the operations.

Hello everyone I need to accomplish this (iphone/objective-c) :

  • I have my thread it has to pe开发者_JAVA技巧rform the operations.
  • the main thread assigns a new task to my thread (the tasks are always the same).
  • each operation has its own id.
  • the main thread when assigning a task to my thread, must check whether this operation is an operation that could stop (cancel) that is running on my thread (if new task id = task running id).

  • Do you have any suggestions on how I might accomplish this?

  • for this work...NSThread or NSOperation?
  • I need a shared data structure and synchronized to the operations?
  • how can I handle the abort the transaction without having to kill the thread? Thanks


Take a look at NSOperation and NSOperationQueue.

0

精彩评论

暂无评论...
验证码 换一张
取 消