473,378 Members | 1,549 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,378 software developers and data experts.

meyers: Item 12: Effective C++

I am looking for a good Lock class implementation that
has barely been implemented in Effective STL of Myers (Item 12).
Any pointers?

Is there an implementation that is good for both OpenMP and pthreads?

Thanks,
--j

Jul 23 '05 #1
4 1959
John wrote:
I am looking for a good Lock class implementation that
has barely been implemented in Effective STL of Myers (Item 12).
Any pointers?
If you mean an object that locks on construction and unlocks on destruction,
they are all over the place.
Is there an implementation that is good for both OpenMP and pthreads?


Why are you using threads?

--
Phlip
http://www.c2.com/cgi/wiki?ZeekLand
Jul 23 '05 #2

I would like to have the option of using OpenMP or threads
depending on the architecture / compiler. Hence I asked.

Phlip wrote:
John wrote:
I am looking for a good Lock class implementation that
has barely been implemented in Effective STL of Myers (Item 12).
Any pointers?
If you mean an object that locks on construction and unlocks on

destruction, they are all over the place.
Is there an implementation that is good for both OpenMP and
pthreads?
Why are you using threads?

--
Phlip
http://www.c2.com/cgi/wiki?ZeekLand


Jul 23 '05 #3
John wrote:
I am looking for a good Lock class implementation that
has barely been implemented in Effective STL of Myers (Item 12).
Any pointers?

Is there an implementation that is good for both OpenMP and pthreads?

OpenMP and thread-locking don't sound they have anything to do with each other.
--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #4
Ioannis Vranos wrote:
OpenMP and thread-locking don't sound they have anything to do with each
other.


Forget that I said that.

--
Ioannis Vranos

http://www23.brinkster.com/noicys
Jul 23 '05 #5

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

Similar topics

12
by: Fred Ma | last post by:
Hello, I was looking at Meyers's "Effective STL", item 23 about choosing between vectors and maps (at least that the choice for me). In many cases, using sorted vectors is faster for lookups. ...
25
by: Matthias | last post by:
Hi, I am just reading that book by Scott Meyers. In Item 4 Meyers suggests to always use empty() instead of size() when probing for emptyness of STL containers. His reasoning is that size()...
1
by: FBergemann | last post by:
Hi, i have a little question concerning Scott Meyer's Effective C++ (2nd edition), Item 7 "Be prepared for out-of-memory conditions". It's about his example for a class specific new_handler()...
2
by: Piotr | last post by:
I am reading Effective STL item 7 My understanding is, instead of doing this: tempate <typename T> struct DeleteObject: public unary_function<const T*, void> { void operator() (const T* ptr)...
2
by: Derek Vincent | last post by:
Using Visual Studio.net 2003 to create an aspx web form I am having a problem selecting an item from DropDownListBox with id= ListBoxStudies. I can see the items from the bound database table but...
15
by: Peter | last post by:
I right now reading this book. And he is iterating some points I'm following since 1996, e.g. exception safety. But e.g. he is missing one of the major exception safety guidelines, which is ...
1
by: mahesh.kanakaraj | last post by:
Hi All, I have a confusion in finding the 'effective content' of a complex type definition in a XML Schema. I shall give you an example situation to clearly explain my problem. Let's have...
2
by: Chris Forone | last post by:
hello group, is there a problem with meyers-singleton when defined in header-file? example (someheader.h): class a { static a& Instance() {static a instance; return instance;} }
4
by: jfwfmt | last post by:
Please pardon my ignorance. I'm writing a C++ STL program after not writing code for 7 years, I'm trying to invoke key_word.inc() using an iterator for a set containing key_word_T. The following...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.