Hi Mark John,

Here's thread-safe as explained in whatis.com

http://www.whatis.com/WhatIs_Search_Results_Exact/1,282033,,00.html?query=thread-safe

Also, when an application is said to be using thread-safe libraries it
means the routines/methods in the library (shared or static) are aware
that other threads of execution are using globally accessible data.  

In C, and C++, most of the standard routines use errno as a global
variable that holds the error code for the most recently executed
function.  But what if you're using a non-thread-safe version of the
standard library (libc), and more than one threads call functions that
mutate errno?  Chances are your application will either behave
erratically, or worse GPF or segfaults -- again depending on how your
application used errno.  

Now, the thread-safe version of libc is aware that more than one threads
can change the value of errno, and provides necessary code so that a
thread's errno is not the same as another's -- most implementations
provide an errno for each thread in an application.  If my rusty C memory
serves me right, the errno implementation in the ISO C (and I think in GNU
C) library is a macro that translates to a modifiable lvalue (*_errno()).

Likely culprits of non-thread-safeness are the string functions -- strtok,
etc.

As fas a Linux' thread implementation, I have read people here say that
THREADS in Linux are actually processes underneath..  Which leads me to a
question, how does linux manage address spaces, and the supposedly shared
data area of the parent process?  (If you may, please explain this as if
I'm a 3rd grader -- I still haven't peaked at Linux' code)

HTH

jeff --

On Sat, 11 Nov 2000, Mark John Buenconsejo wrote:

#Hello!
#
#What do they mean when they say a certain application is 'thread safe'? Does
#it mean it supports threading? What's so special between supporting
#multithreading from multiprocessing. I believe linux don't have support for
#true threading yet, instead emulates this thru processes. I get confuse when
#they say the application is thread safe? Or the application is compiled with
#thread safe libraries What does it mean?
#
#Any enligthenment will ease my confusion.
#
#Thanks!
#
#
#
#_
#Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
#To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]
#

-- 
Jeff Gutierrez
Mapua Online! 
http://www.mapua.org
http://www.mapua.com


_
Philippine Linux Users Group. Web site and archives at http://plug.linux.org.ph
To leave: send "unsubscribe" in the body to [EMAIL PROTECTED]

Reply via email to