Linux thread Learning

Source: Internet
Author: User

Http://blog.csdn.net/hemmanhui/archive/2009/07/15/4346368.aspx

Http://blog.csdn.net/stefmoon/archive/2010/04/10/5469607.aspx

 

[Linux] pthread_mutex_lock and pthread_spin_lock Performance

Http://blog.csdn.net/wwwsq/archive/2009/04/15/4075129.aspx

 

 

Int X; // global variable in the process

Pthread_mutex_t mutex;

Pthread_mutex_init (& mutex, null); // initialize mutex variable mutex Based on the default attribute

Pthread_mutex_lock (& mutex); // lock the mutex variable

... // Operations on variable X

Phtread_mutex_unlock (& mutex); // unlock the mutex variable

Is it... // Variables in the operations on variable X are mutually exclusive. Which variables are protected by mutex? How to Use

 

 

 
Delete reply not displayedShow all repliesShow star repliesShow score reply

Initialization of the pthread_mutex_t variable

 

Http://topic.csdn.net/t/20050823/14/4226188.html

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.