Skip to Content.
Sympa Menu

freetds - Re: [freetds] query and tds_set_state

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] query and tds_set_state
  • Date: Thu, 30 Jun 2005 12:40:39 -0400

> From: Frediano, VF-IT
> Sent: Thursday, June 30, 2005 4:13 AM
>
> > I'm not a big fan of boolean return values. Not getting what
> > you expected isn't always the same as failing.
> >
> > Regards,
> >
>
> Actually we just tests if returned state if what we requested. In
> case of going to query TDS_QUERYING is an error or a success
> depending on original state. Considering thread problems and
>
> if (tds->state != TDS_QUERYING) {
> if (tds_set_state(tds, TDS_QUERYING) != TDS_QUERYING)
> return TDS_FAIL;
> }
>
> if this is not atomic thread1 can check tds->state != TDS_QUERYING
> while thread2 change same thing so each tds_set_state return
> TDS_QUERYING even if tds_set_state is atomic.

OK, I understand, and you're right. Go ahead.

Threads, bah. I hate threads. First we invent protected memory, devise
languages based on exclusive access to it, and use IPC to communicate
between processes. Then we throw all that away and share the memory
among multiple independent paths of execution. Suddenly:

1 if A != B
2 A = B
3 endif

means A could be C on line 4. I might as well work in FORTH.

--jkl


-----------------------------------------
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 we do not
accept
account orders and/or instructions by e-mail, and therefore will not be
responsible
for carrying out such orders and/or instructions. If you, as the intended
recipient
of this message, the purpose of which is to inform and update our clients,
prospects
and consultants of developments relating to our services and products, would
not
like to receive further e-mail correspondence from the sender, please "reply"
to the
sender indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New
York,
NY 10105.




Archive powered by MHonArc 2.6.24.

Top of Page