Uploaded image for project: 'Realm Core'
  1. Realm Core
  2. RCORE-1541

[C-API] Callbacks to attach and detach core threads to SDK runtimes

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None

      Describe your problem or use case

      We need a way to detach from core threads when closing the realm to allow the JVM to shut down. Current the core-notification system spawns a thread and we need to attach this to the JVM to send callbacks to Kotlin, but we have no way to detach the thread once the underlying thread is torn down.

      Describe the solution you'd like

      We would like a solution similar to the sync-thread notification done in https://github.com/realm/realm-core/issues/5966, but just for any thread that core creates that needs to issues calback to the SDK.

      Might be that there is a more appropriate path through the realm_scheduler_t constructed with the CAPI's realm_scheduler_new and its realm_free_userdata_func_t-callback function, but currently I fail to see that this is actually called when realm is closed. Further, detaching through that would require it to be invoked on the notifier thread as that is the only option for detaching a thread from the JVM.

            Assignee:
            Unassigned Unassigned
            Reporter:
            claus.rorbech@mongodb.com Claus Rørbech (Inactive)
            AD Core
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: