473,326 Members | 2,061 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,326 software developers and data experts.

libc and thread safety

Hi,

Is there any info, list or something else regarding
non thread safe libc functions somewhere on the web?

-timo

--
6832 C8EC -------------------------------- 6FBF 9383
D823 4059 --== "reality is the fake you live" ==-- 7DBD 109E
0CD1 -------------------------------- 98DC
Nov 13 '05 #1
6 5071
"Timo Benk" <t_****@web.de> wrote in message
news:bp*************@ID-44377.news.uni-berlin.de...
Hi,

Is there any info, list or something else regarding
non thread safe libc functions somewhere on the web?


I suspect there is. Why not find out? Start here:
www.google.com

-Mike
Nov 13 '05 #2
In <bp*************@ID-44377.news.uni-berlin.de> Timo Benk <t_****@web.de> writes:
Is there any info, list or something else regarding
non thread safe libc functions somewhere on the web?


According to the C standard:

4 The functions in the standard library are not guaranteed to be
reentrant and may modify objects with static storage duration.158)
____________________

158) Thus, a signal handler cannot, in general, call standard
library functions.

Signal handlers are the only form of multithreading supported by the C
standard.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 13 '05 #3
On 20 Nov 2003 17:51:43 GMT, Timo Benk <t_****@web.de> wrote:
Is there any info, list or something else regarding
non thread safe libc functions somewhere on the web?

Depends on whose libc. Your implementation should document it, but
there's no guarantee of portability, since the standard doesn't know
about threads, which is why the question is off-topic here.

--
Al Balmer
Balmer Consulting
re************************@att.net
Nov 13 '05 #4
> According to the C standard:

4 The functions in the standard library are not guaranteed to be
reentrant and may modify objects with static storage duration.158)
____________________

158) Thus, a signal handler cannot, in general, call standard
library functions.
Does this mean we can call system calls from a signal handler without
any problems ?

Signal handlers are the only form of multithreading supported by the C
standard.

I didnt get what you meant by this last line.Could you kindly
elaborate

Regards
Nov 13 '05 #5
In <37**************************@posting.google.com > pa********@SoftHome.net (pandapower) writes:
According to the C standard:

4 The functions in the standard library are not guaranteed to be
reentrant and may modify objects with static storage duration.158)
____________________

158) Thus, a signal handler cannot, in general, call standard
library functions.
Does this mean we can call system calls from a signal handler without
any problems ?


Nope, it means that you're reading impaired.
Signal handlers are the only form of multithreading supported by the C
standard.

I didnt get what you meant by this last line.Could you kindly
elaborate


By the time you learn to read, you'll get it.

Dan
--
Dan Pop
DESY Zeuthen, RZ group
Email: Da*****@ifh.de
Nov 13 '05 #6
In article <bp*************@ID-44377.news.uni-berlin.de>, t_****@web.de
says...
Hi,

Is there any info, list or something else regarding
non thread safe libc functions somewhere on the web?


You will find first of all that comp.programming.threads is a very good
place to ask this type of question, as c.l.c is aimed at pure ISO/ANSI
C only. Unfortunately for you, POSIX threads, or any other thread model
you might care to discuss falls outside of that particular sandbox.

Also, you will find that a number of replacement functions for various
libc routines (typically with the original name, followed by _r() ) were
added for the POSIX pthreads implementation, which should give you some
good hints into which are particularly well known to not be thread safe.
These are defined by POSIX. A good reference book you should be aware of
is "Programming with POSIX Threads" by David R. Butenhof.
--
Randy Howard _o
2reply remove FOOBAR \<,
______________________()/ ()______________________________________________
SCO Spam-magnet: po********@sco.com
Nov 13 '05 #7

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

Similar topics

4
by: Jonathan Burd | last post by:
Greetings everyone, Here is a random string generator I wrote for an application and I'm wondering about the thread-safety of this function. I was told using static and global variables cause...
9
by: Alexander Fleck | last post by:
Hi, I' ve to make a software module thread safe. I know how to realize that and what' re the main topics of thread safety. But I don' t know how thread safety can be tested. I read about a test...
4
by: The Crow | last post by:
for example i have static readonly SqlParameter and i want to clone them at runtime. as clone operation will not write to SqlParameter object, just reading, should i lock that object during read...
22
by: Brett | last post by:
I have a second thread, t2, that errors out and will stop. It's status is then "Stopped". I try to start t2 from thread 1, t1, by checking If t2.threadstate = "Stopped" Then t2.start() ...
4
by: Warren Sirota | last post by:
Hi, I've got a method that I want to execute in a multithreaded environment (it's a specialized spider. I want to run a whole bunch of copies at low priority as a service). It works well running...
6
by: fniles | last post by:
I am using VB.NET 2003 and a socket control to receive and sending data to clients. As I receive data in 1 thread, I put it into an arraylist, and then I remove the data from arraylist and send it...
1
by: paul.hester | last post by:
Hi all, All of the classes in my DAL are static, with constants defining the stored procedures and parameters. I've been having some problems with my site which makes me wonder if there's a...
13
by: arun.darra | last post by:
Are the following thread safe: 1. Assuming Object is any simple object Object* fn() { Object *p = new Object(); return p; } 2. is return by value thread safe?
0
by: Graham Wideman | last post by:
Folks: Can anyone tell me what controls php's "thread safety" feature? I have an installation where phpinfo() is showing Thread safety: enabled, whereas I need it disabled in order to work...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.