Please advise me to how to achieve NSOperation and NSOperationQueue functionality in C++.
Asked
Active
Viewed 670 times
7
-
There isn't such thing in C++, I suggest to use C++11 threads and to implement your own queue class. – Ramy Al Zuhouri Dec 21 '12 at 01:48
-
what is c++11 i.e 11 stands for ? Can i use it with c++ ? Do you have some sample how to achieve the above thing using this ? – user1908860 Dec 21 '12 at 02:05
-
@user1908860 - C++11 refers to the 2011 standard for C++. Before 2011 there were no standard C++ threads. – Pete Becker Dec 21 '12 at 02:27
2 Answers
2
NSOperation
is a class for managing non-critical tasks. You create Operations, and place them on the NSOperationQueue
and each operation is performed as the app executes.
There is no such "equivalent" in C++. C++ is a language, as NSOperationQueue
is part of FoundationKit a part of OSX and iOS, a set of Objective-C objects, that aren't part of the objective-c standard.
What you'll need to research is the Android paradigms for doing task concurrency, and use those. Or you can just manually download the assets from the server, in-lieu of any managed task library.

Alan
- 45,915
- 17
- 113
- 134
-
I need to do more or similar stuff. we don't manual download as we are developing a professional live game. I know NSOperation and NSOperationQueue is part of obj c foundation but my question if we have to achieve similar thing in C++ then how to achieve that ? – user1908860 Dec 21 '12 at 01:50
-
You're not doing something similar in C++. You're doing something similar in Android. C++ is just a language. Look at how Android does concurrent task management, and it should have examples on how to do this in C++. – Alan Dec 21 '12 at 02:10