Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[wasm-mt] Allow JSImport promises to run on managed threadpool worker threads #83838

Closed

Commits on Mar 27, 2023

  1. Configuration menu
    Copy the full SHA
    33b5c4a View commit details
    Browse the repository at this point in the history
  2. Update emsdk deps

    radekdoulik committed Mar 27, 2023
    Configuration menu
    Copy the full SHA
    dff44d4 View commit details
    Browse the repository at this point in the history
  3. Update icu deps

    radekdoulik committed Mar 27, 2023
    Configuration menu
    Copy the full SHA
    ce1a265 View commit details
    Browse the repository at this point in the history
  4. Use new images

    radekdoulik committed Mar 27, 2023
    Configuration menu
    Copy the full SHA
    ed96a04 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    8e6a28c View commit details
    Browse the repository at this point in the history

Commits on Mar 28, 2023

  1. Ignore ExitStatus exceptions

    This should fix these errors:
    
        [wasm test] [23:10:04] dbug: Reached wasm exit
        [wasm test] [23:10:04] info: node:internal/process/promises:246
        [wasm test] [23:10:04] info:           triggerUncaughtException(err, true /* fromPromise */);
        [wasm test] [23:10:04] info:           ^
        [wasm test] [23:10:04] info:
        [wasm test] [23:10:04] info: [UnhandledPromiseRejection: This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason "#<ExitStatus>".] {
        [wasm test] [23:10:04] info:   code: 'ERR_UNHANDLED_REJECTION'
        [wasm test] [23:10:04] info: }
        [wasm test] [23:10:04] info:
        [wasm test] [23:10:04] info: Node.js v17.3.1
        [wasm test] [23:10:04] info: Process node.exe exited with 1
    radekdoulik committed Mar 28, 2023
    Configuration menu
    Copy the full SHA
    81672f4 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    c2cbb94 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    f3edd6e View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4c0cb9e View commit details
    Browse the repository at this point in the history
  5. [mono] Implement a LifoJSSemaphore

    This is a LIFO semaphore with an asynchronous wait that triggers
    callbacks on the JS event loop in case of Release or timeout.
    lambdageek committed Mar 28, 2023
    Configuration menu
    Copy the full SHA
    3d88608 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    55b4649 View commit details
    Browse the repository at this point in the history
  7. copy-paste PortableThreadPool.WorkerThread for threaded WASM

    no changes yet. just copying verbatim to a separate file
    lambdageek committed Mar 28, 2023
    Configuration menu
    Copy the full SHA
    8c74dea View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    b323f0e View commit details
    Browse the repository at this point in the history
  9. Configuration menu
    Copy the full SHA
    51b1fbf View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    3727ff1 View commit details
    Browse the repository at this point in the history
  11. manage emscripten event loop from PortableThreadPool.WorkerThread

    make sure to keep the thread alive after setting up the semaphore
    wait.
    Cleanup the thread when exiting
    lambdageek committed Mar 28, 2023
    Configuration menu
    Copy the full SHA
    763edab View commit details
    Browse the repository at this point in the history
  12. Configuration menu
    Copy the full SHA
    b45d001 View commit details
    Browse the repository at this point in the history
  13. Configuration menu
    Copy the full SHA
    1f7620c View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    06a3cc1 View commit details
    Browse the repository at this point in the history
  15. nit: log thread id as hex in .ts

    Match the C logging for easier grepping
    lambdageek committed Mar 28, 2023
    Configuration menu
    Copy the full SHA
    8574368 View commit details
    Browse the repository at this point in the history
  16. Configuration menu
    Copy the full SHA
    c86cb26 View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    c3cad74 View commit details
    Browse the repository at this point in the history
  18. Add WebWorkerEventLoop internal class to managed event loop keepalive

    Don't explicitly call UnwindToJs as it doesn't know about managed
    code.
    Also avoid mono_thread_exit as that also won't necessarily clean up
    after the interpreter
    lambdageek committed Mar 28, 2023
    Configuration menu
    Copy the full SHA
    e57b262 View commit details
    Browse the repository at this point in the history
  19. Start threadpool threads with keepalive checks

    Add a flag to mono's thread start wrappers to keep track of threads
    that may not want cleanup to run after the Start function returns.
    
    Use the flag when starting threadpool threads.
    lambdageek committed Mar 28, 2023
    Configuration menu
    Copy the full SHA
    07eabcd View commit details
    Browse the repository at this point in the history
  20. HACK: kind of work around the emscripten_runtime_keepalive_push/pop n…

    …o-op
    
    Keep a thread local counter in mono. that we "know" will be right for
    us and manually call unwind_to_js and thread_exit.
    
    This is super-fragile since we don't know what emscripten internals
    might be trying to manipulate the keepalive count and also we are
    exiting the thread with active managed frames, so we might be skipping
    finally clauses and possibly leaking interpreter memory.
    
    This is mainly meant to keep work going on this branch and not
    something we necessarily want to commit
    lambdageek committed Mar 28, 2023
    Configuration menu
    Copy the full SHA
    474607e View commit details
    Browse the repository at this point in the history
  21. support JS Semaphore with --print-icall-table cross compiler

    fixes smoketest on Release builds
    lambdageek committed Mar 28, 2023
    Configuration menu
    Copy the full SHA
    9f45167 View commit details
    Browse the repository at this point in the history
  22. Configuration menu
    Copy the full SHA
    2e1f31f View commit details
    Browse the repository at this point in the history

Commits on Mar 30, 2023

  1. Share PortableThreadPool.WorkerThread common code

    Share the code between non-browser implementations and
    browser+threads.
    
    The differences are just in how the work loop is started and implemented
    lambdageek committed Mar 30, 2023
    Configuration menu
    Copy the full SHA
    dacc0cb View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    10ca330 View commit details
    Browse the repository at this point in the history

Commits on Mar 31, 2023

  1. Configuration menu
    Copy the full SHA
    f4a2c02 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    42388d8 View commit details
    Browse the repository at this point in the history
  3. remove unused arg from async wait semaphore

    don't need both user data and a gchandle
    lambdageek committed Mar 31, 2023
    Configuration menu
    Copy the full SHA
    853938e View commit details
    Browse the repository at this point in the history
  4. rename native semaphore to LifoSemaphoreAsyncWait

    prefix functions with mono_lifo_semaphore_asyncwait_
    lambdageek committed Mar 31, 2023
    Configuration menu
    Copy the full SHA
    cb8b168 View commit details
    Browse the repository at this point in the history
  5. Configuration menu
    Copy the full SHA
    3e8fee4 View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    552f9a5 View commit details
    Browse the repository at this point in the history
  7. Configuration menu
    Copy the full SHA
    812524f View commit details
    Browse the repository at this point in the history

Commits on Apr 3, 2023

  1. Keep track of unsettled JS interop promises in threadpool workers

    Set WorkerThread.IsIOPending when the current thread has unsettled JS
    interop promises.
    
    When IsIOPending is true, the worker will not exit even if it has no
    more work to do.  Instead it will repeatedly wait for more work to
    arrive or for all promises to settle.
    lambdageek committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    50c0f1a View commit details
    Browse the repository at this point in the history
  2. change minimal sample's fetch helper to artificially delay

    the delay is longer that the threadpool worker's semaphore timeout, in
    order to validate that the worker stays alive while there are
    unsettled promises
    lambdageek committed Apr 3, 2023
    Configuration menu
    Copy the full SHA
    c8afaba View commit details
    Browse the repository at this point in the history