Skip to Content.
Sympa Menu

freetds - RE: asprintf vasprintf

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Castellano, Nicholas" <Nicholas_Castellano AT acml.com>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: asprintf vasprintf
  • Date: Wed, 28 Aug 2002 14:47:55 -0400


The performance penalty won't be significant. It will only prevent more
than one dbfcmd() from executing concurrently. Execution is pretty fast
even for large queries, so contention should be minimal.

The SIGSEGV will be synchronous, so it will be delivered to the correct
thread. However, the signal handler is process-wide. So, if some other
thread happens to generate a SIGSEGV while that signal handler is installed,
then it will incorrectly invoke our signal handler. I think I have a
workable solution for this, but it's tricky. I'll see what I can do.

-----Original Message-----
From: bounce-freetds-145195 AT franklin.oit.unc.edu
[mailto:bounce-freetds-145195 AT franklin.oit.unc.edu]
Sent: Wednesday, August 28, 2002 5:01 AM
To: TDS Development Group
Subject: [freetds] RE: asprintf vasprintf


>
> Can you try this patch? It uses a pthread mutex to ensure
> that only one
> thread at a time executes inside the vasprintf() code. I
> can't test this on
> my system right now (my only box with pthreads is DU4.0d, and
> I'm unable to
> compile src/tds/threadsafe.c when _REENTRANT is
> defined...I'll address that
> problem later on)
>
This patch seem to work.
I like your implementation because it require few space (it not require all
printf implementation...). But may have performance penalty due to the
mutex.
Also signal are set per thread or per process? If set per thread is ok but
if setted per process I think this implementation can cause problems... The
first thread that raise signal cause thread to go to saved env... and so do
other thread... two thread with same state?

Also we should always use allocated buffers. If anyone want to use just a
fixed length buffer without possible buffer overflow we haven't a snprintf
implementation...

freddy77

=================================
"STRICTLY PERSONAL AND CONFIDENTIAL

This message may contain confidential and proprietary material for the sole
use of the intended recipient. Any review or distribution by others is
strictly prohibited. If you are not the intended recipient please contact
the sender and delete all copies. The contents of this message that do not
relate to the official business of our company shall be understood as
neither given nor endorsed by it."

=================================

---
You are currently subscribed to freetds as: [Nicholas_Castellano AT acml.com]
To unsubscribe, forward this message to
$subst('Email.Unsub')


The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the
original message. Please note that for certain accounts we do not accept
orders and/or instructions by e-mail, and for those accounts we will not be
responsible for carrying out such orders and/or instructions. Kindly refrain
from sending orders or instructions by e-mail unless you have confirmed that
we accept such communications for your account. Please also note that to
satisfy regulatory requirements we review the outgoing and incoming e-mail
correspondence of staff members serving certain functions.






Archive powered by MHonArc 2.6.24.

Top of Page