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

are cout and printf thread safe?

Hello experts,
are cout and printf and other ostream and stdio functions/libraries are
threadsafe?
i am using gnu gcc3.3.2 on AIX5.2.
and my applications are multithreaded applications.
i am using -lpthread as one of the compiler option.
i am using cout and printf for debugging purpose.
thanks for ur replies in advance.

Thanks and Regards
Nagaraj Hayyal

Nov 2 '05 #1
2 3030
nrhayyal wrote:
Hello experts,
are cout and printf and other ostream and stdio functions/libraries are
threadsafe?
i am using gnu gcc3.3.2 on AIX5.2.
and my applications are multithreaded applications.
i am using -lpthread as one of the compiler option.
i am using cout and printf for debugging purpose.
thanks for ur replies in advance.

Thanks and Regards
Nagaraj Hayyal


That's implementation dependent. The Standard says nothing about
threads. Ask in a group related to your implementation and/or platform.
Nov 2 '05 #2

nrhayyal wrote:
Hello experts,
are cout and printf and other ostream and stdio functions/libraries are
threadsafe?
i am using gnu gcc3.3.2 on AIX5.2.
and my applications are multithreaded applications.
i am using -lpthread as one of the compiler option.
i am using cout and printf for debugging purpose.
thanks for ur replies in advance.

Thanks and Regards
Nagaraj Hayyal


On my system, it's not.

Nov 3 '05 #3

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

Similar topics

5
by: Steven | last post by:
Is printf thread-safe? Someone tell me it isn't, however, I think it is. If it isn't, then why? Thank you in advance. -- Steven Ding
6
by: cylin | last post by:
Dear all, To do below is too long. cout << "Name: " << name << ", Age: " << age << endl; Can cout use "%" to implement? Thanks. cylin.
5
by: uli | last post by:
Hi all! I'm posting to both newsgroups, because it's actually a C++ problem but could be that some of you using Matlab-&-MEX-&-C++ was struggling with the same problem. I'm trying to rewrite...
12
by: Minti | last post by:
Is std::cout slower than printf When we call printf e.g. in printf(20 format conversion specifications, 20 arguments); Is it faster than the std::cout << { 20 redirections to the output...
9
by: liaoo | last post by:
Dear all, I have a question about using cout<<... In standard C, I can use printf("%x",...) to print "hex" number. But in Watcom C++, when using cout<<, I got the "decimal" representation ! ...
25
by: Podrzut_z_Laweczki | last post by:
Hello, I have question (or 2 :)). Is that true that for a large data using scanf/printf instead of cin/cout makes that the program runs faster? And if it is, is it legal to mix scanf/printf with...
12
by: pai | last post by:
Hi, This is a code . the output will be why is this so. Can any nody explain me this.. 4444 2222 7777 8888 aaaa *******************************
10
by: laikon | last post by:
Hello, everyone: this is about overflow in C and C++. int c = 400; printf("%c", c); it print ? on screen, and ascii of '?' is 63.
10
by: Rahul | last post by:
Hi Everyone, I had a query reg printf(). I heard that it can't be used in ISR's as it is non-re-enterant. I didn't get as to why printf is non-re-enterant and why non-re-enterant library can't...
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: 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
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.