Skip to content

Open reflexions to implement a M:N multi threaded dispatcher on NimGo #21

@Alogani

Description

@Alogani

Please read here the definitions I use before responding to this post. If we don't agree on what we talk, we won't talk about much.

Questions

  1. Should the EventLoop and DispatcherLoop be merged together ?
  2. If they are separate, should the EventLoop run in its own thread or each thread would run a shared EventLoop ?
  3. Should each thread have its own task Dispatcher in addition to global task Dispatcher ?
  4. Should it have a fixed number of Threads ? If yes, how many ? If no, determined by what ?
  5. What design should the DispatcherLoop have ?
  • FIFO for all tasks, except LIFO for last task for better caching/responsivness ?
  • FIFO only ?
  1. Other considerations ?

Proposition of response

If I read correctly this paper shared from @mratsim : https://assets.ctfassets.net/oxjq45e8ilak/48lwQdnyDJr2O64KUsUB5V/5d8343da0119045c4b26eb65a83e786f/100545_516729073_DMITRII_VIUKOV_Go_scheduler_Implementing_language_with_lightweight_concurrency.pdf

The answers could be :

  1. No
  2. Separate thread for I/O pool
  3. Yes
  4. Should have 61 Os Threads (why ?)
  5. FIFO with LIFO for last item

However I am wondering how well a single selector can scale. But having multiple selectors by thread is trickier, even if the same fd can be registered in multiple dispatcher (with special considerations for thread safety, but this might be implementation specific).

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions