By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
454,385 Members | 1,739 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 454,385 IT Pros & Developers. It's quick & easy.

c++ and multithreading

P: n/a
Hi

I'm trying to find out some information about the following classes
being thread safe (atomic), ifstream/ofstream. I have looked on google
but have seemed to have gotten more confused before I started.
Is there a good link or refernces that sort of deal with c++ classes &
miltithreading someone could recommend?

Any tips, links or pointers would be greatly appreciated.

Kindest Regards
David

Dec 13 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a

Le Tubs wrote:
Hi

I'm trying to find out some information about the following classes
being thread safe (atomic), ifstream/ofstream. I have looked on google
but have seemed to have gotten more confused before I started.
Is there a good link or refernces that sort of deal with c++ classes &
miltithreading someone could recommend?
It depends on what you mean by thread safe. Note that thread safety
does not imply atomicity.
Any tips, links or pointers would be greatly appreciated.


http://www.sgi.com/tech/stl/thread_safety.html

Dec 13 '05 #2

P: n/a
Le Tubs wrote:
Hi

I'm trying to find out some information about the following classes
being thread safe (atomic), ifstream/ofstream. I have looked on google
but have seemed to have gotten more confused before I started.
Is there a good link or refernces that sort of deal with c++ classes &
miltithreading someone could recommend?

Any tips, links or pointers would be greatly appreciated.

Kindest Regards
David


Standard C++ knows nothing of multithreading, and consequently,
standard C++ objects are not innately thread-safe, but you can fairly
easily wrap them with your platform-specific synchronization objects.
See this article for a snazzy technique:

http://www.cuj.com/documents/s=7998/...p1902alexandr/

See also the Boost.Threads library:

http://boost.org/doc/html/threads.html

Cheers! --M

Dec 13 '05 #3

P: n/a
Le Tubs wrote:
Is there a good link or refernces that sort of deal with c++ classes &
miltithreading someone could recommend?


news:comp.programming.threads

V
Dec 13 '05 #4

P: n/a
On 13 Dec 2005 07:06:02 -0800 in comp.lang.c++, "Le Tubs"
<dl*****@yahoo.co.uk> wrote,
I'm trying to find out some information about the following classes
being thread safe (atomic), ifstream/ofstream.


Unless your compiler/library vendor makes some special promise,
they are in no way thread safe.
Dec 13 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.