473,406 Members | 2,710 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Question about Boost Mutex Implementation

I was browsing through the souce code for the boost mutex
implementation just to understand how the library works. I get the
basic idea: a mutex object is associated with a scoped_lock object.
The scoped_lock object calls private member functions of the mutex,
specifically mutex::do_lock and mutex::do_unlock via static functions
defined in the lock_ops class.

My question is, where is the actual platform-specific call to actually
lock the mutex primitive, e.g. the call to pthread_mutex_lock? In the
boost source code, in the mutex.hpp file, the private member function
do_lock() is declared but not actually defined. Where is the code
that actually calls the platform-specific lock function?

Oct 8 '07 #1
1 3220
ch******@gmail.com wrote:
I was browsing through the souce code for the boost mutex
implementation just to understand how the library works. I get the
basic idea: a mutex object is associated with a scoped_lock object.
The scoped_lock object calls private member functions of the mutex,
specifically mutex::do_lock and mutex::do_unlock via static functions
defined in the lock_ops class.

My question is, where is the actual platform-specific call to actually
lock the mutex primitive, e.g. the call to pthread_mutex_lock? In the
boost source code, in the mutex.hpp file, the private member function
do_lock() is declared but not actually defined. Where is the code
that actually calls the platform-specific lock function?
http://www.google.com/codesearch?hl=...package:boost+
do_lock+show:A39GR61BV8A:-PObAh4uKr8:6IDZIkSVSO4&sa=N&cd=5&ct=rc&cs_p=cvs+
:pserver:anonymous%40boost.cvs.sourceforge.net:/cvsroot/boost-sandbox
+boost-sandbox&cs_f=boost/shmem/sync/posix/shared_mutex.hpp#first

[rebuild the link]

Regards,

Zeppe
Oct 8 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Alejandro Lapeyre | last post by:
I am starting to implement the DOM in .Net. And here comes my first two "dilemas" (questions): 1). In .Net is common and suggested to use ProperCase to define methods. Is acceptable for a DOM...
193
by: Michael B. | last post by:
I was just thinking about this, specifically wondering if there's any features that the C specification currently lacks, and which may be included in some future standardization. Of course, I...
0
by: VB Programmer | last post by:
I am going to use an ActiveX control on my webform. 1. How can I set it up so that if a user views the web page and doesn't have the ActiveX control it immediately/automatically downloads it...
4
by: m_palmer45 | last post by:
Hi, I was looking at the code in the standard lib's mutex.py, which is used for queuing function calls. Here is how it lets you acquire a lock: def testandset(self): """Atomic test-and-set --...
5
by: Brian Hampson | last post by:
I'm new to getting multi-threading working in C#, so I'm looking for some help with Mutexes. I have code that looks like the following: Mutex MyMutex = new Mutex();
3
by: =?iso-8859-1?B?Tm9yZGz2dw==?= | last post by:
Hey there, C++ Coders! I am learning multi-threading with boost and have come up with the following code example shown below. This example implements a test of the producer-consumer design...
1
by: Sarada Prasanna | last post by:
Hi, I have 2 databases(SampleA and SampleB) fully loaded on server A. Now, I need to create DPF environment on Server A (Logical partitioning). Now, if I modify the file db2nodes.cfg as...
3
by: Lars Uffmann | last post by:
I have this wxWidgets OnButtonClick event handler, that apparently holds a lock on all widgets in my form, but this event handler is supposed to end a thread in the background - while that thread...
19
by: =?ISO-8859-1?Q?Nordl=F6w?= | last post by:
I am currently designing a synchronized queue used to communicate between threads. Is the code given below a good solution? Am I using mutex lock/unlock more than needed? Are there any resources...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.