Which thread library should be used in the embedded test LINUX system?

Source: Internet
Author: User
In the embedded test LINUX system, which thread library should be used-Linux general technology-Linux programming and kernel information? The following is a detailed description. Create a process under Redhat9.0. Getpid (); obtain the process ID, and then use pthreadcreate several threads in the process to call getpid, pthreadgetselfid () to the process ID and thread ID in the online process, it is found that the thread's process ID is the same as the process ID to which it belongs, but the thread ID is different. When the gcc thread library is used in a small machine, the result is that the thread ID and process ID are different, that is, the thread is treated as a process, in addition, there are several other threads running. If the thread is treated as a process, the efficiency is relatively low. I checked The linux Thread Library online and found that The LD in The new kernel uses The Native POSIX Thread Library (NPTL ), the small machine uses the thread library in the old GCC.

How can I use the old thread library on Redhat9? Add LD_ASSUME_KERNEL = 2.4.19 to the system environment variable.

Because the NPTL library is not used in earlier versions of the kernel, so that NPTL is not used when LD is connected to the program.

The simulation of a midrange computer simulator is similar to that of a midrange computer without NPTL.
Related Article

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.