Coder Social home page Coder Social logo

Compiling for iOS about rxcpp HOT 16 CLOSED

reactivex avatar reactivex commented on May 14, 2024
Compiling for iOS

from rxcpp.

Comments (16)

cnlier avatar cnlier commented on May 14, 2024

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.

notlion avatar notlion commented on May 14, 2024

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.

headinthebox avatar headinthebox commented on May 14, 2024

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.

kirkshoop avatar kirkshoop commented on May 14, 2024

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.

notlion avatar notlion commented on May 14, 2024

Got it compiling with pthreads last night via the post linked by @cnlier. Thanks!

from rxcpp.

headinthebox avatar headinthebox commented on May 14, 2024

Nice.

from rxcpp.

galvare2 avatar galvare2 commented on May 14, 2024

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.

notlion avatar notlion commented on May 14, 2024

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.

kirkshoop avatar kirkshoop commented on May 14, 2024

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.

notlion avatar notlion commented on May 14, 2024

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.

kirkshoop avatar kirkshoop commented on May 14, 2024

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.

stefanfisk avatar stefanfisk commented on May 14, 2024

@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.

notlion avatar notlion commented on May 14, 2024

@stefanfisk My experimental-ios branch should compile for iOS. Follow the instructions for Xcode in the Readme.

from rxcpp.

ildarsharafutdinov avatar ildarsharafutdinov commented on May 14, 2024

@notlion, have you managed to test your solution for iOS?

from rxcpp.

notlion avatar notlion commented on May 14, 2024

@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.

kirkshoop avatar kirkshoop commented on May 14, 2024

@ValeryKopylov has applied this fix. 25dbb11

from rxcpp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.