473,396 Members | 1,938 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Atomic statements execute more than once inside a thread

Hi.
I'm write a "passthru" application which is reading from one socket
and writing to a pool of outcoming sockets. From time to time I have
date duplicated in the socket and when I debug the function below,
using step by step, I find that printf("LINE 1\n"); executes more than
once every time I hit F10 (Visual C++). I never saw something like
that.
Very weird!!!!!!!!!!!

unsigned __stdcall inWriteIncomingSocket(void* data) {
cMySocket *IncomingSocket;
cMySocket *OneSocket;
unsigned char chTCPBuffer[1024];
unsigned int uiTCPBufferSize;
int inResult;
int i, j;

inWriteToLog("inWriteIncomingSocket", FOREGROUND_RED +
FOREGROUND_BLUE);

IncomingSocket = (cMySocket *)data;
while(1) {
Sleep(SLEEP_TIME2);

inResult = IncomingSocket->hGetSocketHandler();
if(inResult<=0) continue;

//printf("ESCRIBIENDO A INCOMING SOCKET\n");

for(i=0; i<inSocketsPoolSize; i++) {
Sleep(SLEEP_TIME1);
OneSocket = SocketsPool[i];
if(!OneSocket) continue;

if(OneSocket-
>uiCurrentState==SOCKET_STATE_DATA_FOR_CLIENT_AVAI LABLE) {
if(OneSocket->bGetTCPBuffer(chTCPBuffer, &uiTCPBufferSize)) {
//printf("PTVC->NAC (SIZE=
%d)--------------------------------------------------\n",
uiTCPBufferSize);
printf("LINE 1\n");
printf("LINE 2\n");
for(j=0; j<uiTCPBufferSize; j++) {
printf("%02X ", chTCPBuffer[j]);
}
printf("\n\n");

if(!IncomingSocket->bSend(chTCPBuffer, uiTCPBufferSize)) {
OneSocket->vdForceDisconnect();
}

}

OneSocket->uiCurrentState = SOCKET_STATE_SENDING_RECEIVING;

//IncomingSocket->bSend();
}

}
}

}

Sep 12 '07 #1
14 1710
In article <11*********************@w3g2000hsg.googlegroups.c om>,
<ju*********@gmail.comwrote:
>I'm write a "passthru" application which is reading from one socket
and writing to a pool of outcoming sockets. From time to time I have
date duplicated in the socket and when I debug the function below,
using step by step, I find that printf("LINE 1\n"); executes more than
once every time I hit F10 (Visual C++). I never saw something like
Visual C++ doesn't immediately sound like a C compiler. Are you
sure you have the right newsgroup? This is the C language newsgroup.
>that.
Very weird!!!!!!!!!!!
>unsigned __stdcall inWriteIncomingSocket(void* data) {
You have not given us a definition for the macro or type
named "__stdcall" so we cannot tell what that line means.
> cMySocket *IncomingSocket;
cMySocket *OneSocket;
You have not defined cMySocket for us.
> unsigned char chTCPBuffer[1024];
unsigned int uiTCPBufferSize;
int inResult;
int i, j;

inWriteToLog("inWriteIncomingSocket", FOREGROUND_RED +
FOREGROUND_BLUE);
What is inWriteToLog, and what are FOREGROUND_RED and
FOREGROUND_BLUE ?

> IncomingSocket = (cMySocket *)data;
> while(1) {
Sleep(SLEEP_TIME2);
What is Sleep, and what is SLEEP_TIME2?

> inResult = IncomingSocket->hGetSocketHandler();
We have no idea what IncomingSocket->hGetSocketHandler does.
> if(inResult<=0) continue;
> //printf("ESCRIBIENDO A INCOMING SOCKET\n");
Ah, // comments. That's C99, not allowed in C90. I don't have any
personal experience with Microsoft C compilers myself, but a fair
number of people have posted here that Microsoft does not have
a functional C99 compiler (or much of one at all), so if your compiler
isn't blowing up on that // comment, then we have a hard time
predicting what it is going to do with any of your code. Non-compliant
compilers have non-compliant behaviour.

> for(i=0; i<inSocketsPoolSize; i++) {
What's inSocketsPoolSize?
> Sleep(SLEEP_TIME1);
What's SLEEP_TIME1?
> OneSocket = SocketsPool[i];
What's SocketsPool?
> if(!OneSocket) continue;
> if(OneSocket->uiCurrentState==SOCKET_STATE_DATA_FOR_CLIENT_AVAI LABLE) {
No idea what SOCKET_STATE_DATA_FOR_CLIENT_AVAILABLE is either, or
uiCurrentState

//printf("PTVC->NAC (SIZE=%d)--------------------------------------------------\n", uiTCPBufferSize);
printf("LINE 1\n");
Not surprising you have problems with that line: printf() is defined
by the standard C library as being a varadic function, but you have not
defined any prototype for it (by #include <stdio.h>), so the compiler
can misinterpret the arguments, point the the wrong place; printing
the same line twice is well within the bounds of allowed behaviour
when you call upon a varadic function without having a proper prototype.
> printf("LINE 2\n");
for(j=0; j<uiTCPBufferSize; j++) {
What's uiTCPBufferSize?
printf("%02X ", chTCPBuffer[j]);
}
printf("\n\n");

if(!IncomingSocket->bSend(chTCPBuffer, uiTCPBufferSize)) {
We don't know anything about bSend() either.
> OneSocket->vdForceDisconnect();
}

}

OneSocket->uiCurrentState = SOCKET_STATE_SENDING_RECEIVING;
SOCKET_STATE_SENDING_RECEIVING is undefined as well.
>
//IncomingSocket->bSend();
}

}
}

}


The code you have have shown us cannot pass compilation in any
conforming compiler without extensions -- it violates too many constraints.

Your Subject: line refers to threads, which are not defined by
standard C, so we cannot give you much assistance if something in
your code is invoking thread behaviour. Which we cannot tell, as
you call upon a number of undefined functions, any one of which
could be invoking magic thread behaviour for all we know.

If you can reproduce the behaviour in standard C, sticking to the
facilities provided by standard C, then we could try to debug the
problem. If you cannot reproduce the behaviour without using
extensions that are outside of C, then that indicates the problem
fundamentally involves interaction with those extensions, and you
should then be asking the provider of those extensions. A microsoft
programming newsgroup perhaps.
--
I was very young in those days, but I was also rather dim.
-- Christopher Priest
Sep 12 '07 #2
On Wed, 12 Sep 2007 05:56:10 +0000 (UTC), ro******@ibd.nrc-cnrc.gc.ca
(Walter Roberson) wrote:
>In article <11*********************@w3g2000hsg.googlegroups.c om>,
<ju*********@gmail.comwrote:
>>I'm write a "passthru" application which is reading from one socket
and writing to a pool of outcoming sockets. From time to time I have
date duplicated in the socket and when I debug the function below,
using step by step, I find that printf("LINE 1\n"); executes more than
once every time I hit F10 (Visual C++). I never saw something like

Visual C++ doesn't immediately sound like a C compiler. Are you
sure you have the right newsgroup? This is the C language newsgroup.
And gcc doesn't immediately sound like a C compiler (it sounds to me
on first impression that it compiles .cc files, which are generally
considered to be C++ files). From your reasoning, I guess we should
respond unequivocally to those who are using the gcc compiler,
regardless of the context of their question, with:

"gcc doesn't immediately sound like a C compiler. Are you sure you
have the right newsgroup? This is the C language newsgroup."

That sounds pretty abrasive to me.

[snip]
>Ah, // comments. That's C99, not allowed in C90. I don't have any
personal experience with Microsoft C compilers myself, but a fair
number of people have posted here that Microsoft does not have
a functional C99 compiler (or much of one at all), so if your compiler
isn't blowing up on that // comment, then we have a hard time
predicting what it is going to do with any of your code. Non-compliant
compilers have non-compliant behaviour.
// foo.c
int main(void)
{
// return success status
return 0;
}

When compiled with VC++ 6.0 SP5, I get:

foo.c(1) : warning C4001: nonstandard extension 'single line comment'
was used
foo.c(4) : warning C4001: nonstandard extension 'single line comment'
was used

When compiled with gcc:

gcc foo.c -o foo

I get:

// no warnings

By your definition, Microsoft VC++ 6.0 has compliant behavior and gcc
does not, assuming of course that "blowing up" equates to issuing a
diagnostic.

Best regards
--
jay
Sep 12 '07 #3
jaysome <ja*****@hotmail.comwrites:
On Wed, 12 Sep 2007 05:56:10 +0000 (UTC), ro******@ibd.nrc-cnrc.gc.ca
(Walter Roberson) wrote:
>>In article <11*********************@w3g2000hsg.googlegroups.c om>,
<ju*********@gmail.comwrote:
>>>I'm write a "passthru" application which is reading from one socket
and writing to a pool of outcoming sockets. From time to time I have
date duplicated in the socket and when I debug the function below,
using step by step, I find that printf("LINE 1\n"); executes more than
once every time I hit F10 (Visual C++). I never saw something like

Visual C++ doesn't immediately sound like a C compiler. Are you
sure you have the right newsgroup? This is the C language newsgroup.

And gcc doesn't immediately sound like a C compiler (it sounds to me
on first impression that it compiles .cc files, which are generally
considered to be C++ files). From your reasoning, I guess we should
respond unequivocally to those who are using the gcc compiler,
regardless of the context of their question, with:

"gcc doesn't immediately sound like a C compiler. Are you sure you
have the right newsgroup? This is the C language newsgroup."

That sounds pretty abrasive to me.
[...]

There's a big difference. The name "Visual C++" makes it sound
*exactly* like a C++ compiler, not a C compiler. If it also acts as a
C compiler, it's misnamed. There's nothing "abrasive" about assuming
that something with "C++" in its name is a C++ compiler; it's a
mistake, but one that the vendor encourages you to make.

If I'd never heard of "gcc", the name wouldn't lead me to assume that
it's a C++ compiler. If I'd heard of "cc", I'd probably assume that
"gcc" is a C compiler.

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <* <http://users.sdsc.edu/~kst>
"We must do something. This is something. Therefore, we must do this."
-- Antony Jay and Jonathan Lynn, "Yes Minister"
Sep 12 '07 #4
Walter Roberson said:

<snip>
Visual C++ doesn't immediately sound like a C compiler. Are you
sure you have the right newsgroup? This is the C language newsgroup.
There's pedantry, and then there's pedantry. For the benefit of anyone
who doesn't already know that "Visual C++" includes a C compiler, I
have some earth-shattering news for you. "Visual C++" includes a C
compiler. Yes, the OP was way off-topic, but his use of "Visual C++"
was not the reason why.

<snip>

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Sep 12 '07 #5
In article <5N******************************@bt.com>,
Richard Heathfield <rj*@see.sig.invalidwrote:
>Walter Roberson said:
>Visual C++ doesn't immediately sound like a C compiler. Are you
sure you have the right newsgroup? This is the C language newsgroup.
>There's pedantry, and then there's pedantry. For the benefit of anyone
who doesn't already know that "Visual C++" includes a C compiler, I
have some earth-shattering news for you. "Visual C++" includes a C
compiler.
This is comp.lang.c . I'm not supposed to have to keep track of
all of the compilers from minor C vendors, whose conformance varies
from week to week. The evidence from the code given was that
it was *not* a conforming C compiler that was in use. C with extensions
perhaps.
--
There are some ideas so wrong that only a very intelligent person
could believe in them. -- George Orwell
Sep 12 '07 #6
Walter Roberson wrote:
In article <5N******************************@bt.com>,
Richard Heathfield <rj*@see.sig.invalidwrote:
There's pedantry, and then there's pedantry. For the benefit of
anyone who doesn't already know that "Visual C++" includes a C
compiler, I have some earth-shattering news for you. "Visual C++"
includes a C compiler.

This is comp.lang.c . I'm not supposed to have to keep track of
all of the compilers from minor C vendors, whose conformance varies
from week to week.
So why did you feel moved to comment about a toolset you don't know?

There's no requirement that you reply.
The evidence from the code given was that
it was not a conforming C compiler that was in use. C with extensions
perhaps.
Nonsense. You could easily have mentioned that the topics raised were,
by their nature, off-topic. There was no need for you speculate about
the compiler.

Brian
Sep 12 '07 #7
jaysome wrote:

// foo.c
int main(void)
{
// return success status
return 0;
}

When compiled with VC++ 6.0 SP5, I get:

foo.c(1) : warning C4001: nonstandard extension 'single line comment'
was used
foo.c(4) : warning C4001: nonstandard extension 'single line comment'
was used

When compiled with gcc:

gcc foo.c -o foo

I get:

// no warnings

By your definition, Microsoft VC++ 6.0 has compliant behavior and gcc
does not, assuming of course that "blowing up" equates to issuing a
diagnostic.
Well, in ANSI mode at least my VC++ 6.0 installation do translate:

C:\temp>more test.c
// foo.c
int main(void)
{
// return success status
return 0;
}

C:\temp>cl /Za test.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

test.c
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/out:test.exe
test.obj

while GNU cc don't need high warning level to reject:

$ cat test.c
// foo.c
int main(void)
{
// return success status
return 0;
}
$ gcc -ansi test.c
test.c:1: error: expected identifier or â(â before â/â token

--
Tor <torust [at] online [dot] no>
Sep 12 '07 #8
ju*********@gmail.com wrote:
Hi.
I'm write a "passthru" application which is reading from one socket
and writing to a pool of outcoming sockets. From time to time I have
date duplicated in the socket and when I debug the function below,
using step by step, I find that printf("LINE 1\n"); executes more than
once every time I hit F10 (Visual C++). I never saw something like
that.
Windows sockets and threads, are very much off-topic here, you should
post to a WIN32 news group.

unsigned char chTCPBuffer[1024];
unsigned int uiTCPBufferSize;
[...]
if(OneSocket->bGetTCPBuffer(chTCPBuffer, &uiTCPBufferSize)) {
Broken API design, unless the bGetTCPBuffer() function never can "write"
more than 1024 bytes, you have commited the cardinal sin: YABOB.
YABOB - Yet Another Buffer Overflow Bug

--
Tor <torust [at] online [dot] no>
Sep 12 '07 #9
In article <wc******************************@bt.com>,
Richard Heathfield <rj*@see.sig.invalidwrote:
><cough type="splurfleglaargh">
Microsoft, a minor C vendor? I'm no MS cheerleader, as you probably
know, but my keyboard is thanking its guardian angel that I wasn't
drinking coffee when I read that.
</cough>
Microsoft is known as a C++ vendor, a C.Net vendor, a C# vendor,
but as a C vendor??

The "Visual C++ 2005 Features" sheet,
http://msdn2.microsoft.com/en-us/visualc/aa336448.aspx

mentions C exactly once:

Visual C++ 2005 includes the industry-standard Active Template Library
(ATL), the Microsoft Foundation Class (MFC) libraries, and standard
libraries such as the Standard C++ Library, and the C RunTime Library
(CRT), which has been extended to provide security enhanced
alternatives to functions known to pose security issues.

Every other reference on the page implies that the product is C++
not C.

How much of C99 has Microsoft implemented? Are they known to
be in the midst of a Great Leap Forward to get C99 in place?
Or are they indeed a merely a player in the field of standard C
compilers?
--
Is there any thing whereof it may be said, See, this is new? It hath
been already of old time, which was before us. -- Ecclesiastes
Sep 12 '07 #10
Walter Roberson said:
In article <wc******************************@bt.com>,
Richard Heathfield <rj*@see.sig.invalidwrote:
>><cough type="splurfleglaargh">
Microsoft, a minor C vendor? I'm no MS cheerleader, as you probably
know, but my keyboard is thanking its guardian angel that I wasn't
drinking coffee when I read that.
</cough>

Microsoft is known as a C++ vendor, a C.Net vendor, a C# vendor,
but as a C vendor??
Yeah. I've used Microsoft C on so many client sites that I've lost
count. I would not like to have to defend the position that all these
clients bought their C compilers from Microsoft by accident, never
realising that "Visual C++" could compile C until they took off the
shrinkwrap.
The "Visual C++ 2005 Features" sheet,
http://msdn2.microsoft.com/en-us/visualc/aa336448.aspx

mentions C exactly once:

Visual C++ 2005 includes the industry-standard Active Template
Library (ATL), the Microsoft Foundation Class (MFC) libraries, and
standard libraries such as the Standard C++ Library, and the C
RunTime Library (CRT), which has been extended to provide security
enhanced alternatives to functions known to pose security issues.

Every other reference on the page implies that the product is C++
not C.
Yes, it's true that Microsoft think of C as low-priority. Nevertheless,
they continue to sell a program that compiles C programs using C rules.
How much of C99 has Microsoft implemented?
I have no idea. My own opinion is that C99 is a dead duck, and I'm not
about to criticise Microsoft for agreeing with me. Of course, that
doesn't stop me from criticising them for all kinds of other stuff. :-)
Are they known to
be in the midst of a Great Leap Forward to get C99 in place?
Or are they indeed a merely a player in the field of standard C
compilers?
Merely a player? No, they're a player.

Whenever I need to compile C code under Windows, I always turn to my
trusty Visual Studio. It's the best Windows-based C compiler I have.
For C++, I wouldn't touch it with a bargepole unless I had absolutely
no other choice. From my perspective, Microsoft ships a badly-named but
otherwise excellent C compiler, and the fact that they bundle C++ with
it is of no consequence to me.

--
Richard Heathfield <http://www.cpax.org.uk>
Email: -www. +rjh@
Google users: <http://www.cpax.org.uk/prg/writings/googly.php>
"Usenet is a strange place" - dmr 29 July 1999
Sep 13 '07 #11
On Wed, 12 Sep 2007 20:56:29 +0000 (UTC), ro******@ibd.nrc-cnrc.gc.ca
(Walter Roberson) wrote in comp.lang.c:
In article <5N******************************@bt.com>,
Richard Heathfield <rj*@see.sig.invalidwrote:
Walter Roberson said:
Visual C++ doesn't immediately sound like a C compiler. Are you
sure you have the right newsgroup? This is the C language newsgroup.
There's pedantry, and then there's pedantry. For the benefit of anyone
who doesn't already know that "Visual C++" includes a C compiler, I
have some earth-shattering news for you. "Visual C++" includes a C
compiler.

This is comp.lang.c . I'm not supposed to have to keep track of
all of the compilers from minor C vendors, whose conformance varies
from week to week. The evidence from the code given was that
it was *not* a conforming C compiler that was in use. C with extensions
perhaps.
Just curious, do you know of any C compiler from any vendor that
functions in its most strictly conforming mode by default, that is
with no invocation options? I have never seen one that I recall.

This reminds me of the legal tussle between Microsoft and Sun a decade
and change ago. One of Sun's complaints about Microsoft violating its
Java IP was that Microsoft's compiler accepted Microsoft's extensions,
many of them Windows specific, by default.

But so did Microsoft's C and C++ compilers, and so did (and still do)
Borland's C and C++ compilers. And so did (and so) every version of
gcc I have ever used.

So the question stands, do you know of any C compiler from any source
that uses its most strictly conforming mode by default, and must
actually be invoked with options to allow extensions?

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://c-faq.com/
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.club.cc.cmu.edu/~ajo/docs/FAQ-acllc.html
Sep 13 '07 #12
On Wed, 12 Sep 2007 23:53:52 +0200, Tor Rustad
<to********@hotmail.comwrote:
>jaysome wrote:

>// foo.c
int main(void)
{
// return success status
return 0;
}

When compiled with VC++ 6.0 SP5, I get:

foo.c(1) : warning C4001: nonstandard extension 'single line comment'
was used
foo.c(4) : warning C4001: nonstandard extension 'single line comment'
was used

When compiled with gcc:

gcc foo.c -o foo

I get:

// no warnings

By your definition, Microsoft VC++ 6.0 has compliant behavior and gcc
does not, assuming of course that "blowing up" equates to issuing a
diagnostic.

Well, in ANSI mode at least my VC++ 6.0 installation do translate:

C:\temp>more test.c
// foo.c
int main(void)
{
// return success status
return 0;
}

C:\temp>cl /Za test.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.

test.c
Microsoft (R) Incremental Linker Version 6.00.8168
Copyright (C) Microsoft Corp 1992-1998. All rights reserved.

/out:test.exe
test.obj

while GNU cc don't need high warning level to reject:

$ cat test.c
// foo.c
int main(void)
{
// return success status
return 0;
}
$ gcc -ansi test.c
gcc *does* require some "high warning level" option to reject the
code. You added the "-ansi" option to do so. Just like I checked the
box labeled "Disable language extensions" in Visual C++ to do so.

If you're going to use Microsoft Visual C++ to compile C code that you
submit to this newsgroup, consider checking the box labeled "Disable
language extensions" in the project settings. And if you're going to
use gcc to compile C code that you submit to this newsgroup, consider
using these options (at a minimum):

gcc -ansi -pedantic -W -Wall

Any warnings you get from either of these compilers should be
addressed before submitting your code. And if there is a warning that
you don't understand, then IMHO you have a right to ask "why" in this
newsgroup; the explanation for such warnings may well further your
knowledge of Standard C, and benefit others as well.

Regards
--
jay
Sep 13 '07 #13
jaysome wrote:

[...]
gcc *does* require some "high warning level" option to reject the
code. You added the "-ansi" option to do so. Just like I checked the
box labeled "Disable language extensions" in Visual C++ to do so.
No so, in ANSI mode, gcc *rejected* your code at the *default* warning
level.

Furthermore, I showed that Microsoft VC++ 6.0 *translated* your code
without a *warning* when using the /Za switch (at the *default* warning
level):

What point did you make by comparing VC++ in ANSI mode, with gcc in GNU
mode?

If you're going to use Microsoft Visual C++ to compile C code that you
submit to this newsgroup, consider checking the box labeled "Disable
language extensions" in the project settings.
Apparently, you have never used this compiler without the GUI:

cl /help
[...]
/Za disable extensions (implies /Op)

:)
And if you're going to
use gcc to compile C code that you submit to this newsgroup, consider
using these options (at a minimum):

gcc -ansi -pedantic -W -Wall
I prefer stronger checks than this, and usually write lint clean code.

--
Tor <torust [at] online [dot] no>
Sep 13 '07 #14
Walter Roberson wrote:
In article <wc******************************@bt.com>,
Richard Heathfield <rj*@see.sig.invalidwrote:
><cough type="splurfleglaargh">
Microsoft, a minor C vendor? I'm no MS cheerleader, as you probably
know, but my keyboard is thanking its guardian angel that I wasn't
drinking coffee when I read that.
</cough>

Microsoft is known as a C++ vendor, a C.Net vendor, a C# vendor,
but as a C vendor??
Sure is.

I didn't like the Microsoft .NET IDE much, so I rapidly swapped back to
using the VC++ 6.0 IDE, but many of my co-workers use the .NET IDE
during their embedded C work.

Before testing the code on target, we simulate it under Windows.

Likewise, when writing C code for mainframes, I always try to test as
much as possible under Windows, before swapping to an editor without
syntax coloring, flat file-system and command-line debugger.

How much of C99 has Microsoft implemented? Are they known to
be in the midst of a Great Leap Forward to get C99 in place?
Could very well be. From watching the feedback the VC++ development team
received on their blog, when asking for future wishes, clearly support
for C++0X was requested a lot... and Dinkumware TR1 comes with a C99
library:

http://www.dinkumware.com/tr1.aspx

--
Tor <torust [at] online [dot] no>
Sep 13 '07 #15

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: David.Tymon | last post by:
>Description: MySQL v4.1.0-alpha only allows a client to prepare a maximum of 254 statements. On the 255th mysql_prepare() call, a failure is returned with no information returned by...
42
by: Shayan | last post by:
Is there a boolean flag that can be set atomically without needing to wrap it in a mutex? This flag will be checked constantly by multiple threads so I don't really want to deal with the overhead...
5
by: hikums | last post by:
Begin Atomic Declare a integer; Set a=(select count(1) from claims.table1); if a<>0 then import into c:\tmptyfile.txt of del replace into claims.table1; end if; End!
5
by: Pegboy | last post by:
What does it mean to make a function atomic? Something I read on it wasn't very clear, but made me think that I needed to disable interrupts for that function. Whether that's the case or not,...
161
by: KraftDiner | last post by:
I was under the assumption that everything in python was a refrence... so if I code this: lst = for i in lst: if i==2: i = 4 print lst I though the contents of lst would be modified.....
28
by: robert | last post by:
In very rare cases a program crashes (hard to reproduce) : * several threads work on an object tree with dict's etc. in it. Items are added, deleted, iteration over .keys() ... ). The threads are...
6
by: blackstreetcat | last post by:
consider this code : int i; //gobal var Thread1: i=some value; Thread2: if (i==2) dosomething(); else dosomethingelse();
7
by: Joe HM | last post by:
Hello - I was wondering if there is a simple way of ensuring that some statements are executed as an "atomic operation". Here is what I am dealing with in a GUI ... Dim mAppDomain As...
7
by: =?Utf-8?B?QVRT?= | last post by:
HOWTO Run multiple SQL statements from ASP/ADO to an Oracle 10g. Please help, I'm trying to write an ASP page to use ADO to run a long query against an Oracle 10g database, to create tables,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.