Comments (16)
The __thread specifier is not supported on iOS (nor is thread_local). Perhaps can be replaced with pthread_setspecific, see here: http://alex.tapmania.org/2011/03/simple-thread-local-storage-with-pthreads.html
from rxcpp.
Thanks, @cnlier. pthread_setspecific
seems fairly straightforward. If one of the maintainers is listening.. Is iOS a platform you guys are interested in supporting? Also, is thread-local storage integral to RxCpp? Would it be possible to use it in a single-threaded context without?
from rxcpp.
Pretty sure we'd like to run Rx everywhere.
@kirkshoop will know for sure if there are other places, but a threadlocal typically used in the current thread scheduler https://github.com/Reactive-Extensions/RxCpp/blob/master/Rx/v2/src/rxcpp/schedulers/rx-currentthread.hpp also called trampoline scheduler https://github.com/Netflix/RxJava/blob/875cfd7d4cd90d2b9dfb58c782518f503497687e/rxjava-core/src/main/java/rx/schedulers/TrampolineScheduler.java (you can see the ThreadLocal there as well).
from rxcpp.
Yep, we want rxcpp to work on iOS.
The current thread scheduler appears to be the only place that uses thread local storage.
We will get to this, but contributions are welcome!
from rxcpp.
Got it compiling with pthreads last night via the post linked by @cnlier. Thanks!
from rxcpp.
Nice.
from rxcpp.
I'm also interested in getting this to compile on IOS - @notlion could you maybe put up a pull request with your changes to get it to compile, or walk me through what you did?
from rxcpp.
I pushed my changes here:
https://github.com/notlion/RxCpp/tree/experimental-ios
It compiles and the tests pass. I don't have much experience with threaded code, so I can't say if the implementation is correct or not. Let me know how it goes!
from rxcpp.
If you sign the CLA http://cla.msopentech.com and submit the pull request I would be happy to review and merge this.
from rxcpp.
Awesome. I'd be happy to submit a PR once I've had a chance to test out RxCpp a bit more. It's a little tough to get started due to the limited documentation. Your ofxRx project has been really helpful, though. I'm trying to learn by adapting it to Cinder. Thanks!
from rxcpp.
Cinder is a great idea! I just pushed changes to ofxRx to add some debugging info to the app background.
I look forward to a pull request :)
from rxcpp.
@notlion I'd love to have a look at this as well, but I'm having even less success with building for iOS. how exactly are you going about it?
from rxcpp.
@stefanfisk My experimental-ios branch should compile for iOS. Follow the instructions for Xcode in the Readme.
from rxcpp.
@notlion, have you managed to test your solution for iOS?
from rxcpp.
@ildarsharafutdinov Not outside of compilation. In the end I decided to go with a signals/slots implementation since my use case didn't require most of what RxCpp is capable of.
from rxcpp.
@ValeryKopylov has applied this fix. 25dbb11
from rxcpp.
Related Issues (20)
- Implementing logical OR between multiple operations HOT 2
- Flat map serializes output when using observable<>::create HOT 2
- Question about the coordinator in sources and why it causes segfault HOT 5
- Q: optional thread pool interface
- action_tailrecurser condition explanation
- Example test under Rx/v2/examples/tests fails
- `std::aligned_storage` is deprecated in C++23
- Docs for flat_map should reference concat_map but instead reference flat_map HOT 1
- Const overload of resource::get()
- Docs for rxcpp::sources::range are the same as those from rxcpp::observable<>::create
- identity_current_thread is bad "default" scheduler for operators
- error: unknown type name 'stdscr' auto timeout(AN&&... an) const
- Segmentation fault in case of using new_thread + current_thread
- combine_latest fails build with MSVC 19.34.31935.0 when C++ standard is set to 17 HOT 3
- Documentation request: provide examples for C++ that match examples from the "Intro to Rx" article HOT 2
- README doesn't explain how to run tests
- `find_package(rxcpp "4.1.1" CONFIG REQUIRED)` fails because CMake module version is not updated
- Create iterate error commit 562 "[Perfomance] Significantly reduce amount of copies/moves inside operators"
- run_loop dispatch optimization
- `is_hashable` is broken in C++20 (`std::hash<T>::result_type` and `::argument_type` were removed)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rxcpp.