Uploaded image for project: 'C Driver'
  1. C Driver
  2. CDRIVER-4736

Custom _mongoc_usleep function

    • Type: Icon: New Feature New Feature
    • Resolution: Fixed
    • Priority: Icon: Minor - P4 Minor - P4
    • 1.26.0
    • Affects Version/s: None
    • Component/s: None
    • None

      Hi!

       

      At my workplace we use libmongoc in a single-threaded mode atop of stackful-coroutines-based asynchronicity: we have a small amount of threads that manage lots of coroutines, and instead of suspending a thread for I/O or sleeping we suspend a coroutine, while a thread is free to process other bits of workload, if any.

       

      It works wonders with custom implementation of mongoc_stream_t, however because of blocking usleep call usage  in topology rescan we had to patch libmongoc to allow users to provide their own implementation of _mongoc_usleep (coroutine-friendly nonblocking sleep in our case).

       

      Would you be interested in reviewing/accepting such a patch, which adds a possibility for users to provide their own sleep implementation?

            Assignee:
            kevin.albertson@mongodb.com Kevin Albertson
            Reporter:
            i.trofimow@yandex.ru itrofimow N/A
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: