KorGE

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Cross platform coroutines?

    General
    2
    2
    62
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Adam Brown
      Adam Brown last edited by

      Is there anything we can do for cross-platform parallel processing?

      I've got some large arrays I want to process in parallel, and doing so with coroutines works for the JVM, but both JS and Native don't work.

      So what options do I have to make this work everywhere?

      Currently I'm doing something similar to:

      launch(Dispatchers.Default) {
          for(split up the input) {
              coroutineScope {
                  launch(Dispatchers.Default) {
                         // Do some processing
                  }
              }
          }
      }
      
      1 Reply Last reply Reply Quote 0
      • soywiz
        soywiz last edited by

        Check these links:

        • https://github.com/Kotlin/kotlinx.coroutines/issues/1147
        • http://blog.davidvassallo.me/2020/01/15/kotlin-coroutines-flow-parallel-processing/
        1 Reply Last reply Reply Quote 1
        • First post
          Last post