android - Bionic (android libc) 互斥变量

标签 android pthreads mutex libc bionic

bionic libc 支持哪些类型的互斥体?

  • 递归
  • 定时
  • 自适应
  • 错误检查

最佳答案

来自文档(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.

关于android - Bionic (android libc) 互斥变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2282949/

相关文章:

sqlite - 在 VxWorks 上将 SQLite 集成到 RTP 应用程序中时 pthreads 崩溃

c - Linux页面错误内存中的互斥锁

java - 如何在 Intellij IDEAS/Android Studio 中制作链接到源代码中特定行的日志?

android - 为组创建离线 SQLite 数据库

c++ - 在特定时间后唤醒线程

c - 是否有不支持可重入互斥锁或递归锁的平台?

multithreading - C++ 使用互斥量锁定流运算符

java - 如何只允许某些 int 值作为 Java 中方法的参数?

android - 如何替换 TextView 上的部分文本?

c - 如何将网格传递给 "void my_func(void *args)"