List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:September 2 1999 5:09pm
Subject:Re: How to make a thread-safe client library?
View as plain text  
>>>>> "mhlee" == mhlee  <iso-8859-1> writes:

>> 
mhlee> Does it mean that I can forget about the -lmysys -lstring -ldbug
mhlee> and
mhlee> net_serv.o stuff and get a thread-safe ( socket interrupt safe)
mhlee> client
mhlee> library by doing so? So that I can write a threaded server only
mhlee> utilizes
mhlee> libmysqlclient?
>> 
>> You can get a thread safe client by only using libmysqlclient.  The
>> only thing you don't get by using this is that reads can automaticly
>> be aborted after a certain timeout. For this you need the thr_alarm
>> module + a interupt handler.
>> 

mhlee> Thanks for Monty's  reply:)

mhlee> Does this means that resulting libmysqlclient will be thread-safe except one
mhlee> thing that it can automaticly be aborted when mysql_store_result? If so,
mhlee> will it return safe MYSQL_RES data structure?

Yes, it can be automaticly aborted if it doesn't get data from the
server within a specific time.  If this happens it will not return a
MYSQL_RES structure but instead a NULL pointer and set the error flag.

mhlee> And, how to add thr_alarm module and interupt handler if I decided to only
mhlee> use libmysqlclient?

I tried to explain this in my previous mail.  Short answer is to
check how sql/mysqld.cc uses it!

mhlee> Thanks in advance!

Regards,
Monty
Thread
How to make a thread-safe client library?李敏宏2 Sep
  • How to make a thread-safe client library?Michael Widenius2 Sep
  • Re: How to make a thread-safe client library?§õ±Ó§»2 Sep
    • Re: How to make a thread-safe client library?Michael Widenius2 Sep
  • Re: How to make a thread-safe client library?sinisa2 Sep
    • Re: How to make a thread-safe client library?Daniel E. White2 Sep
      • Re: How to make a thread-safe client library?sinisa2 Sep