бионический (android libc) мьютекс варианты - PullRequest
2 голосов
/ 17 февраля 2010

Какие типы мьютекса поддерживает bionic libc?

  • рекурсивный
  • приуроченная
  • Адаптивный
  • errorchecking

Ответы [ 2 ]

4 голосов
/ 24 февраля 2010

из документации (bionic / libc / docs / OVERVIEW.TXT):

The implementation is based on futexes and strives to provide *very* short
code paths for common operations. Notable features are the following:

  - pthread_mutex_t, pthread_cond_t are only 4 bytes each.

  - Normal, recursive and error-check mutexes are supported, and the code
    path is heavily optimized for the normal case, which is used most of
    the time.

  - Process-shared mutexes and condition variables are not supported.
    Their implementation requires far more complexity and was absolutely
    not needed for Android (which uses other inter-process synchronization
    capabilities).

    Note that they could be added in the future without breaking the ABI
    by specifying more sophisticated code paths (which may make the common
    paths slightly slower though).

  - There is currently no support for read/write locks, priority-ceiling in
    mutexes and other more advanced features. Again, the main idea being
    that this was not needed for Android at all but could be added in the
    future.
0 голосов
/ 13 марта 2015

Так что-нибудь изменилось за 5 лет?

...