views:

26

answers:

2

Hello all,

I have a scenario, working on iPhone development.

I got 3 threads , 2 thread performs XML parsing operation and the last one verification operation.

How to run them sequentially.

Any help!.

+1  A: 

If you want to run the process sequentially - just use one thread.

Paul Alexander
@Paul I could do that if there where no NSXMLParser involved.
Ameya
+3  A: 

You want to look at NSOperation and NSOperationQueue - when you have an NSOperation, you can call "addDependency" and that way the operation will not run until the other dependancies are complete.

Look for "Setting Dependencies" halfway down this document:

http://developer.apple.com/cocoa/managingconcurrency.html

Note that you can have an NSOperationQueue have more than one worker thread, so it could handle all of the XML parsing operations and the verification one.

Kendall Helmstetter Gelner