c++ and multithreading

L

Le Tubs

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
 
M

Maxim Yegorushkin

Le said:
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
 
M

mlimber

Le said:
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/cujcexp1902alexandr/

See also the Boost.Threads library:

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

Cheers! --M
 
D

David Harmon

On 13 Dec 2005 07:06:02 -0800 in comp.lang.c++, "Le Tubs"
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,522
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top