Skip to Content.
Sympa Menu

freetds - RE: asprintf vasprintf

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: ZIGLIO Frediano <Frediano.Ziglio AT vodafoneomnitel.it>
  • To: "'TDS Development Group'" <freetds AT franklin.metalab.unc.edu>
  • Subject: RE: asprintf vasprintf
  • Date: Wed, 28 Aug 2002 11:00:45 +0200


>
> 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."

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




Archive powered by MHonArc 2.6.24.

Top of Page