Closed nitish24p closed 6 months ago
Okay i think i need to have access to the js invoker here and then call invoke Async and this should be fine then
@nitish24p Any updates?)
@nitish24p Any updates?
https://github.com/nitish24p/react-native-multithreadding-jsi/blob/main/cpp/react-native-multithreadding-lite.cpp#L34 I ended up doing something like this, although on a different repo, but the idea was the same, you need access to the js Callinvoker, that can be done by adjusting your podspec file to include the CallInvoker headers, and then you should have access to the jsCallInvoker on the bridge
https://github.com/nitish24p/react-native-multithreadding-jsi/blob/main/cpp/react-native-multithreadding-lite.cpp#L34 I ended up doing something like this, although on a different repo, but the idea was the same, you need access to the js Callinvoker, that can be done by adjusting your podspec file to include the CallInvoker headers, and then you should have access to the jsCallInvoker on the bridge
Hey @nitish24p how did you learn about CallInvoker and threading related to react native? This seems very advanced.
Also, why did you choose to create global variables for spawnTask
and spawnTaskAsync
instead of adding two new functions similar to multiply
?
Thanks.
@carlosalmonte04 i was experimenting with JSI, i learnt about JSI mostly through the following resources
If you see multiple, doesnt need JSI runtime as an arg, its a pure function returning an output, in my case i need the jsi runtime to accces variables passed to the main jsi function hence added it inside the install function
similar issue here #38059
In my case, somehow RAM space becomes full, it mostly happens on older iPhone devices like iPhone 8 or X, I have to optimize to make RAM by code refactoring
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.
This issue was closed because it has been stalled for 7 days with no activity.
Description
I am creating a JSI function to get some values from MMKV (key value store) as a callback (Basically non blocking call. The code i have metioned below works fine when i have my JSC runtime but gives the error when i use hermes engine. I have forked the react-native-mmkv library and added my own method to it to run some code in a background thread.
When i run the same code via JSC the code seems to be working. I have also tried this with react-native version 0.68.5 and with RN 0.66 but got same error
Version
0.68.5
Output of
npx react-native info
System: OS: macOS 12.3.1 CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz Memory: 57.34 MB / 16.00 GB Shell: 5.8 - /bin/zsh Binaries: Node: 12.13.0 - /usr/local/bin/node Yarn: 1.22.19 - /usr/local/bin/yarn npm: 6.12.0 - /usr/local/bin/npm Watchman: 2022.11.14.00 - /usr/local/bin/watchman Managers: CocoaPods: 1.11.3 - /usr/local/bin/pod SDKs: iOS SDK: Platforms: DriverKit 21.4, iOS 15.4, macOS 12.3, tvOS 15.4, watchOS 8.5 Android SDK: API Levels: 25, 28, 29, 30, 31, 32 Build Tools: 27.0.3, 28.0.3, 30.0.2, 30.0.3, 31.0.0, 32.0.0, 32.1.0 System Images: android-25 | Google APIs Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom, android-30 | Google Play Intel x86 Atom, android-Tiramisu | Google APIs Intel x86 Atom_64 Android NDK: Not Found IDEs: Android Studio: 2021.3 AI-213.7172.25.2113.9123335 Xcode: 13.3/13E113 - /usr/bin/xcodebuild Languages: Java: 11.0.8 - /usr/bin/javac npmPackages: @react-native-community/cli: Not Found react: 17.0.2 => 17.0.2 react-native: 0.68.5 => 0.68.5 react-native-macos: Not Found npmGlobalPackages: react-native: Not Found
Steps to reproduce
Mentioned in code above
Snack, code example, screenshot, or link to a repository
HermesExecutorFactory.cpp
CRASH LOGS
Javascript code