Android Native IPC Scenario Support situation

Source: Internet
Author: User
Tags semaphore

    1. Binder-binders that do not support native layers
    2. Memory sharing-not supported
    3. Semaphore (signal semaphore)-not supported
    4. Message Queuing-not supported
    5. Signal-support, but can not be used Sigqueue message, can only be used to install the signal, to collect native crash log
    6. Pipelines-anonymous pipes, support
    7. Pipeline-FIFO, support
    8. Socket-Support

[Reference] Why Binder is not supported in native Https://groups.google.com/forum/?fromgroups=#!topic/android-ndk/1QmVRrNckfM

Why not support memory sharing, Message Queuing, semaphores, see https://android.googlesource.com/platform/ndk/+/4e159d95ebf23b5f72bb707b0cb1518ef96b3d03/ DOCS/SYSTEM/LIBC/SYSV-IPC. Txt

Https://groups.google.com/forum/#!topic/android-ndk/FzJIsJIxCX4

Http://stackoverflow.com/questions/18603267/cross-process-locking-with-android-ndk

Pipe available, see http://stackoverflow.com/questions/8471552/porting-c-code-which-uses-fork-to-android

Description of the document in the Android source code: Http://www.netmite.com/android/mydroid/1.6/bionic/libc/docs/SYSV-IPC.TXT

(The file is in Android4.) 3 appears to have moved out of the document)

Android does not support for System V IPCs, i.e. the facilities provided by thefollowing standard Posix headers:  <sys/s em.h>/   * SysV semaphores */  <sys/shm.h>/   * SysV Shared memory segments */  <sys/msg.h> /   * SysV message queues */  <sys/ipc.h>/* General   IPC Definitions */the reason for this is due to the FA Ct., by design, they leads to globalkernel resource leakage.

The reason is to prevent kernel resource leaks.

In addition:fork () also try not to use.

The truth is simple: we should not control the bottom of Android, these APIs can cause system instability.

Https://groups.google.com/forum/#!msg/android-platform/80jr-_A-9bU/nkzslcgVrfYJ

"Bear on Mind" the Dalvik VM doesn ' t like fork () much, and goes into conniptions if you try to do *any* work between t He fork () and the EXEC (). ”

Https://groups.google.com/forum/#!topic/android-ndk/FzJIsJIxCX4

Android Native IPC Scenario Support situation

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.