473,385 Members | 1,402 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,385 software developers and data experts.

thread problem...

I've a problem in the use of threads, they don't work as i want them
to.
Here's the code, the problem is that if i uncomment the
//pthread_join(thread_ID, NULL);, the main program stops until the
spawned thread is finished, but that's not the intended way, because i
need that the opc variable change only when the user pushes a key, i
think it has something to do with the pthread_attr_set(atribute)
options, but i didn't get with the answer in the man(3).
The way i need it works is that main continues looping inside the while
even if the thread hasn't finished.
By the way i did't do the mygetch function, but it's not the problem
with the thread.

//------------------------------------------------------------
// This example tries to show the use of pthreadss,
// it only runs on Linux, because of the pthread.h
// header file.
//
// It has many bugs, you can only run it in a terminal
// started in a X-session, otherwise it will crash, the main
// problem is that i commented out the pthread_join line, and
// i made that because that line waits for the thread to
// end, and in this example it wouldn't work, i'm almost
// sure that changing the attr attributes can make this
// run better, any way, i didn't find the solution, another
// problem is that the thread runs too fast, so it's
// difficult to apreciate well the moves of the character.
// So, if you think you can resolve those problems, please
// send me a mail, or just modify the code, but please, let
// know, 'cause i really want to learn the solution.
//
// Author: Juan Francisco Benavides Nanni.
// mail: el*****@gmail.com
// URL: http://mmabj.tk
// date: 29/12/2005
//------------------------------------------------------------

#include <stdio.h>
#include <pthread.h>
#include <termios.h>
#include <unistd.h>

#define MAXWIDX 78
#define MAXWIDY 19
#define MIN 0
#define CENTER 10

#define gotoxy(x,y) printf("\x1B[%i;%iH",(y),(x))
#define clrscr() printf("\x1B[2J")

#define UP 115
#define DOWN 120
#define LEFT 122
#define RIG 99
#define SALE 27

void mover(int *opc);
int mygetch();

int main(){
pthread_t thread_ID;
pthread_attr_t attr;
int opc, last, x, y;
pthread_attr_init(&attr);
pthread_attr_setscope(&attr, PTHREAD_SCOPE_PROCESS);
pthread_setconcurrency(2);
char car = '^';
opc = UP;
y = CENTER;
x = y * 4;
while(1){
if(opc == SALE) break;
clrscr();
switch(opc){
case UP:
if(y > MIN) y -= 1;
else y = MAXWIDY;
car = '^';
break;
case DOWN:
if(y < MAXWIDY) y += 1;
else y = MIN;
car = 'v';
break;
case LEFT:
if(x > MIN) x -= 1;
else x = MAXWIDX;
car = '<';
break;
case RIG:
if(x < MAXWIDX) x += 1;
else x = MIN;
car = '>';
break;
case SALE:
break;
default:
opc = last;
}
gotoxy(x, y);
printf("%c", car);
last = opc;
pthread_create(&thread_ID, &attr, (void *) mover, &opc);
//pthread_join(thread_ID, NULL);
}
}

void mover(int *opc){
*opc = mygetch();
}

int mygetch(){
struct termios oldt, newt;
int ch;
tcgetattr( STDIN_FILENO, &oldt );
newt = oldt;
newt.c_lflag &= ~( ICANON | ECHO );
tcsetattr( STDIN_FILENO, TCSANOW, &newt );
ch = getchar();
tcsetattr( STDIN_FILENO, TCSANOW, &oldt );
return ch;
}

Jan 1 '06 #1
39 1833
On 31 Dec 2005 20:56:03 -0800, "el*****@gmail.com" <el*****@gmail.com>
wrote in comp.lang.c:
I've a problem in the use of threads, they don't work as i want them
to.
Off-topic here, the C language does not define or support threads.
Threads are a non-standard extension to the language, and are
implemented differently on different platforms.

[snip]
//------------------------------------------------------------
// This example tries to show the use of pthreadss,
// it only runs on Linux, because of the pthread.h
// header file.


[snip]

The place to ask for help with Linux threads is
news:comp.os.linux.development.apps. Good luck.

--
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.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jan 1 '06 #2
The correct place would be to ask in comp.programming.threads.

Jack, <pthread.h> refers to POSIX threads, not Linux threads.

Jan 1 '06 #3
"el*****@gmail.com" <el*****@gmail.com> writes:
I've a problem in the use of threads, they don't work as i want them
to.


Standard C doesn't support threads. Try comp.programming.threads.

--
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.
Jan 1 '06 #4
"clayne" <cl****@anodized.com> writes:
The correct place would be to ask in comp.programming.threads.

Jack, <pthread.h> refers to POSIX threads, not Linux threads.


Please read <http://cfaj.freeshell.org/google/>.

--
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.
Jan 1 '06 #5
Your memory that short that you cannot remember the context of my
statement from within a 5 post thread originating within the same day?
It's pretty obvious what I was referring to - quoting was unnecessary.
If anything, the context was completely discernable from what I wrote -
but keep beating that Google Groups quoting horse... if I sound
defensive - it's not defense - it's annoyance at unnecessary
instructing. Get an intelligent news reader, start sorting by thread,
or mentor people who drop quotes on a 300 post thread, not pointless 5
post ones. How's that blood pressure coming? :)

Keith Thompson wrote:
"clayne" <cl****@anodized.com> writes:
The correct place would be to ask in comp.programming.threads.

Jack, <pthread.h> refers to POSIX threads, not Linux threads.


Please read <http://cfaj.freeshell.org/google/>.


Jan 1 '06 #6
clayne said:
Your memory that short that you cannot remember the context of my
statement from within a 5 post thread originating within the same day?
Usenet is an asynchronous medium, and comp.lang.c receives hundreds of
articles a day. What makes you think your contributions are so vital to
Keith that he should commit to memory the context of every thread in which
you post an article?
if I sound defensive


You don't. You sound naive. It is a problem that may be cured by education
and experience, or may not. Those who attempt to educate naive users here
in comp.lang.c live in hope that it /is/ possible to cure naivete.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jan 1 '06 #7
Richard Heathfield wrote:
Usenet is an asynchronous medium, and comp.lang.c receives hundreds of
articles a day. What makes you think your contributions are so vital to
Keith that he should commit to memory the context of every thread in which
you post an article?
Newsreader. Sort by thread. Boy that was hard wasn't it? Regardless,
context was obvious from message.
You don't. You sound naive. It is a problem that may be cured by education
and experience, or may not. Those who attempt to educate naive users here
in comp.lang.c live in hope that it /is/ possible to cure naivete.


11+ years on the Internet, it's safe for me to say naivete isn't the
issue. I know when to
quote and when it's not needed. In the previous case, it was apparent
what I was
referring to - the reply I added was only pertinent to those who read
the thread in
the first place, i.e. delete it on sight if you didn't. It was the
pedantic reply on quoting
that is trumpeting endlessly around here which got on my nerves.

At the end of the day, get things done, or argue about how we're going
to get things done? I'd rather just get it done.

Jan 1 '06 #8
clayne wrote:
Richard Heathfield wrote:
Usenet is an asynchronous medium, and comp.lang.c receives hundreds of
articles a day. What makes you think your contributions are so vital to
Keith that he should commit to memory the context of every thread in which
you post an article?
Newsreader. Sort by thread. Boy that was hard wasn't it? Regardless,
context was obvious from message.


You still don't understand Usenet. There is absolutely no guarantee that
the message you are replying to has arrived. How does sorting by thread
(or anything else) help when you don't HAVE anything to sort?
You don't. You sound naive. It is a problem that may be cured by education
and experience, or may not. Those who attempt to educate naive users here
in comp.lang.c live in hope that it /is/ possible to cure naivete.


11+ years on the Internet, it's safe for me to say naivete isn't the
issue.


It obviously is still a problem, since you assume everyone has seen what
you have seen.
I know when to
quote and when it's not needed. In the previous case, it was apparent
what I was
referring to
No, it was only apparent to people who happened to have the previous
article visible.
- the reply I added was only pertinent to those who read
the thread in
the first place, i.e. delete it on sight if you didn't. It was the
pedantic reply on quoting
that is trumpeting endlessly around here which got on my nerves.
If you don't like the way thing are meant to be done, i.e. quoting
properly, then don't hang around in groups where people actually care.
At the end of the day, get things done, or argue about how we're going
to get things done? I'd rather just get it done.


Well, since the best way to get things done is to do them properly, do
them properly and don't argue about it then.
--
Flash Gordon
Living in interesting times.
Although my email address says spam, it is real and I read it.
Jan 1 '06 #9
In article <11**********************@g44g2000cwa.googlegroups .com>,
clayne <cl****@anodized.com> wrote:
Richard Heathfield wrote the usual crap:
Usenet is an asynchronous medium, and comp.lang.c receives hundreds of
articles a day. What makes you think your contributions are so vital to
Keith that he should commit to memory the context of every thread in which
you post an article?
Note that assuming ignorance/inexperience (or pretending to do so) rather
than admitting the possibility of disagreement (I.e., the earth is either
round or it isn't) is a standard debaters dirty trick. Gets used around
here a lot.
Newsreader. Sort by thread. Boy that was hard wasn't it? Regardless,
context was obvious from message.
Sing it, sister!
You don't. You sound naive. It is a problem that may be cured by education
and experience, or may not. Those who attempt to educate naive users here
in comp.lang.c live in hope that it /is/ possible to cure naivete.


11+ years on the Internet, it's safe for me to say naivete isn't the
issue. I know when to quote and when it's not needed. In the previous
case, it was apparent what I was referring to - the reply I added was only
pertinent to those who read the thread in the first place, i.e. delete it
on sight if you didn't. It was the pedantic reply on quoting that is
trumpeting endlessly around here which got on my nerves.


Yes, they are just beating a dead horse. Pretending that the Usenet hasn't
changed at all in the last 15 years.

Most of these guys are so old that 15 years is nothing to them.
At the end of the day, get things done, or argue about how we're going
to get things done? I'd rather just get it done.


Then you are clearly in the wrong newsgroup...

Jan 1 '06 #10
Kenny McCormack said:
In article <11**********************@g44g2000cwa.googlegroups .com>,
clayne <cl****@anodized.com> wrote:
Richard Heathfield wrote the usual crap:
Usenet is an asynchronous medium, and comp.lang.c receives hundreds of
articles a day. What makes you think your contributions are so vital to
Keith that he should commit to memory the context of every thread in
which you post an article?


Note that assuming ignorance/inexperience (or pretending to do so) rather
than admitting the possibility of disagreement (I.e., the earth is either
round or it isn't) is a standard debaters dirty trick.


Whether the earth is round depends on your definition of "round", and there
was no dirty-trick debating in the text you quoted above.
--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jan 1 '06 #11
In article <dp**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com>,
Richard Heathfield <in*****@invalid.invalid> wrote:
Kenny McCormack said:
In article <11**********************@g44g2000cwa.googlegroups .com>,
clayne <cl****@anodized.com> wrote:
Richard Heathfield wrote the usual crap:

Usenet is an asynchronous medium, and comp.lang.c receives hundreds of
articles a day. What makes you think your contributions are so vital to
Keith that he should commit to memory the context of every thread in
which you post an article?


Note that assuming ignorance/inexperience (or pretending to do so) rather
than admitting the possibility of disagreement (I.e., the earth is either
round or it isn't) is a standard debaters dirty trick.


Whether the earth is round depends on your definition of "round", and there
was no dirty-trick debating in the text you quoted above.


I could assert that 2+2=4 and you'd disagree.

Note to observers: I'm not kidding. I fully expect a post from him within
the hour "proving" me wrong.

Jan 1 '06 #12
*** rude topposting of rude material corrected ***

clayne wrote:
Keith Thompson wrote:
"clayne" <cl****@anodized.com> writes:

The correct place would be to ask in
comp.programming.threads.

Jack, <pthread.h> refers to POSIX threads, not Linux
threads.


Please read <http://cfaj.freeshell.org/google/>.


Your memory that short that you cannot remember the context of
my statement from within a 5 post thread originating within the
same day? It's pretty obvious what I was referring to - quoting
was unnecessary. If anything, the context was completely
discernable from what I wrote - but keep beating that Google
Groups quoting horse... if I sound defensive - it's not defense
- it's annoyance at unnecessary instructing. Get an intelligent
news reader, start sorting by thread, or mentor people who drop
quotes on a 300 post thread, not pointless 5 post ones. How's
that blood pressure coming? :)


FYI, yes. Some of us are senile and read several hundred posts
daily. Our readers automatically destroy or hide read posts.

Failure to include *clipped* context, and topposting, are both evil
sins, which foul up communications in general. This is why the
google interface to Usenet is so appalling.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Jan 1 '06 #13

"Kenny McCormack" <ga*****@yin.interaccess.com> wrote
Note that assuming ignorance/inexperience (or pretending to do so) rather
than admitting the possibility of disagreement (I.e., the earth is either
round or it isn't) is a standard debaters dirty trick. Gets used around
here a lot.

Your newreader added a spurious capital to the last sentence. It happens to
the best of us - autocorrection is often a nuisance.
Jan 1 '06 #14
Jack Klein wrote
(in article <g5********************************@4ax.com>):
The place to ask for help with Linux threads is
news:comp.os.linux.development.apps. Good luck.


Actually, comp.programming.threads is probably a more focused
group to ask such a question, not to mention one or more members
of the POSIX committee that came up with pthreads are known to
subscribe.
--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw

Jan 1 '06 #15
Richard Heathfield <in*****@invalid.invalid> writes:
Kenny McCormack said: [snip] Whether the earth is round depends on your definition of "round", and there
was no dirty-trick debating in the text you quoted above.


Richard, *please* don't feed the troll. clayne may still be educable;
it's far past time to realize that Kenny isn't and never will be.

--
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.
Jan 1 '06 #16
On 31 Dec 2005 22:11:29 -0800, "clayne" <cl****@anodized.com> wrote in
comp.lang.c:
The correct place would be to ask in comp.programming.threads.
The correct place to ask WHAT??

This group is littered with instructions on how to quote properly,
even if you are using the idiot broken Google groups interface. Like
Microsoft before it, Google is not going to succeed in redefining
email and usenet etiquette at its whim.
Jack, <pthread.h> refers to POSIX threads, not Linux threads.
Part of the OP's original post, which I quoted and you failed to
quote, along with everything else in my reply, was:
// This example tries to show the use of pthreadss,
// it only runs on Linux, because of the pthread.h
// header file.


Kindly read the three lines above, carefully. Especially the middle
one. Perhaps the OP's Linux distro (and which one is it, with which
kernel?) implements POSIX threads in a 100% conforming manner. Perhaps
not, I've seen quite a few failures of true POSIX conformance in
various Linux distributions over the years.

Note that the C language doesn't know or care whether Linux pthreads
are POSIX conforming. The OP asked for help with a program that in
his own words he wants to run only on Linux, the proper redirection is
to news:comp.os.linux.development.apps, just as I said.

If the Linux application experts think he would be better off in
news:comp.programming.threads, they will tell him so.

--
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.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Jan 2 '06 #17
Well, thanks anyway to all of you, but i finally found the answer,
thanks to this book
http://www.advancedlinuxprogramming....04-threads.pdf,
instead of the commented line //pthread_join(thread_ID, NULL);, i use
this one: pthread_detach(thread_ID); and i changed the const MAXWIDY to
78, and that's all, now it works good, by the way, sorry for the
off-topic.

Jan 2 '06 #18
In article <ln************@nuthaus.mib.org>,
Keith Thompson <ks***@mib.org> wrote:
Richard Heathfield <in*****@invalid.invalid> writes:
Kenny McCormack said:

[snip]
Whether the earth is round depends on your definition of "round", and there
was no dirty-trick debating in the text you quoted above.


Richard, *please* don't feed the troll. clayne may still be educable;
it's far past time to realize that Kenny isn't and never will be.


See what I mean about these twerps endlessly pretending to assume lack of
education or experience (in their enemies), when the fact is that they (the
twerps) are just plain wrong?

Jan 2 '06 #19
"Kenny McCormack" <ga*****@yin.interaccess.com> wrote
Richard, *please* don't feed the troll. clayne may still be educable;
it's far past time to realize that Kenny isn't and never will be.


See what I mean about these twerps endlessly pretending to assume lack of
education or experience (in their enemies), when the fact is that they
(the
twerps) are just plain wrong?

I did think that maybe Keith was being too harsh, but I now see that he was
right.

Bye bye.
Jan 2 '06 #20
Malcolm wrote:
"Kenny McCormack" <ga*****@yin.interaccess.com> wrote
Richard, *please* don't feed the troll. clayne may still be
educable; it's far past time to realize that Kenny isn't and
never will be.


See what I mean about these twerps endlessly pretending to
assume lack of education or experience (in their enemies),
when the fact is that they (the twerps) are just plain wrong?

I did think that maybe Keith was being too harsh, but I now see
that he was right.


Statistics: According to my filter log, Kenny has tripped it in a
15:1 ratio over any other twerp since Dec. 15th. I.E. that plonk
is fifteen times more efficacious than any other.

Bear in mind that PLONKs have twofold effects. They prevent one
being annoyed by pointless mouthings, and by ignoring the mouther
they tend to remove the mouthers amusement, thus causing said
mouther to eventually disappear.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Jan 3 '06 #21
What I find most annoying about comp.lang.c is how the regulars would
rather have weekly arguments over the definition of an 'int' than
actually ever recognize the validity of "unix-specific" questions... as
if C was invented without unix ever being present.

Get real. That's why comp.unix.programmer and comp.programming.threads
are much more easy-going and enable people to actually learn rather
than be beat down at the first sight of trivial (and pragmatically
meaningless) language assumptions.

For you die-hard "you forgot to include stdlib.h, therefore I cannot
even look at your code" regulars out there: I vote to change the
group's name to comp.lang.c.asperger.syndrome to fit your endless
inflexibility and need to control all things that don't fit into your
world view (quip replies without quotes that don't matter anyways,
top-posting (how about using your eyes, move them down to the quoted
section and read it first, there there, that wasn't too hard was it?),
and other my-way-or-the-highway type whines ever-present here).

Learning should be enjoyable for all, and open to mistakes, not a damn
battlefield. But hey, it's that important to be right, right?

Jan 3 '06 #22
clayne said:
What I find most annoying about comp.lang.c is how the regulars would
rather have weekly arguments over the definition of an 'int'
No, we'd rather not have such arguments. All the regulars know what an int
is. Unfortunately, some people who are not regulars do not know what an int
is, despite having been programming in what they laughingly call C for a
considerable number of years.
than
actually ever recognize the validity of "unix-specific" questions...
But such questions are surely better dealt with by Unix experts than by C
experts? Is this not obvious? Is this not common sense?

<rant snipped>
Learning should be enjoyable for all, and open to mistakes, not a damn
battlefield.
I agree entirely. But when people refuse to learn, what's the point in
trying to teach them?
But hey, it's that important to be right, right?


It can be, yes, when lives are at stake. Badly-written code can kill people.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jan 3 '06 #23
In article <dp**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com>,
Richard Heathfield <in*****@invalid.invalid> wrote:
(The usual RH psychobabble - deleted)
(Then clayne says)
But hey, it's that important to be right, right?


It can be, yes, when lives are at stake. Badly-written code can kill people.


You need to learn how to distinguish between Usenet and real life.

When you can show me where the contents of a Usenet post affect life/death
in the real world (i.e., not in the funny little online world), then we'll
talk, OK?

What clayne and others like him are able to do (and which seems to escape
the "regulars" here) is realize that online/Usenet is a surreal existence,
only loosely connected with "real life".

Jan 3 '06 #24

Kenny McCormack wrote:
When you can show me where the contents of a Usenet post affect life/death
in the real world (i.e., not in the funny little online world), then we'll
talk, OK?

Companies like Siemens use C in a lot of programs used in cars and
airplanes, some of them in vital places. There are a lot of cases of
tragedies (cars and planes) related to badly written code (even C).
Last year at least two car companies pulled new car types from the
market after problems with the electronics and software. If it's an
off-topic question and there are other channels with people better
prepared to answer them, then those should be the places to ask those
questions. The answers can really lead to life and death situations in
the real world.

Jan 3 '06 #25
In article <11*********************@f14g2000cwb.googlegroups. com>,
nelu <ta********@gmail.com> wrote:
....
Companies like Siemens use C in a lot of programs used in cars and
airplanes, some of them in vital places. There are a lot of cases of
tragedies (cars and planes) related to badly written code (even C).
Last year at least two car companies pulled new car types from the
market after problems with the electronics and software. If it's an
off-topic question and there are other channels with people better
prepared to answer them, then those should be the places to ask those
questions. The answers can really lead to life and death situations in
the real world.


You, also, need to get some help in learning to distinguish between Usenet
and real life.

Jan 3 '06 #26

Kenny McCormack wrote:
You, also, need to get some help in learning to distinguish between Usenet
and real life.


Even when a lot of people apply what they learn on Usenet in real-life?

Jan 3 '06 #27
Richard Heathfield <in*****@invalid.invalid> schrieb:
But hey, it's that important to be right, right?


It can be, yes, when lives are at stake. Badly-written code can kill people.


So you are, like me, for the death penalty for using gets()?

No, seriously, I know what you mean because some of my past
project where in such fields that, had I some serious mistake
in my software (not only security holes and buffer overflows,
I mean algorithms working the way they're implemented and not
the way they were intended) could lead to the death or serious
injury of people not even having the faintest clue that there
is some kind of software that protects them.

Just think of automated quality control systems for parts
that are later used in your car's ESP, airbag, brakes or
the turbine blades of the airplane your just crossing the
alps in.

Another category is a device that I've made that is used
to detect oil theft/smuggle at large scale in south ameri-
ca and can bring innocent people to jail if not functioning
correctly under all circumstances. Or, if he was able to
manipulate the software in this device, or even the hardware,
without my software detecting it, will enable him to continue
his capital crimes, happily smiling at the customs officer.

Markus
Jan 3 '06 #28
nelu <ta********@gmail.com> schrieb:
Even when a lot of people apply what they learn on Usenet in real-life?


And perhaps Kenny should stay away from usenet for a while and
try to get one.

A (real) life, I mean.
I'm not sure if I can laugh about him. I know a lot of
people thinking like he does. And that's not funny.

Markus
Jan 3 '06 #29
Kenny McCormack <ga*****@yin.interaccess.com> schrieb:
You, also, need to get some help in learning to distinguish between Usenet
and real life.


Not every one is as dumb as you are and just trolls around
in the newsgroup insulting people. Can't you imagine that
(apart from lots of students and wanna-be hobby programmers)
people come here to ask questions about problems
they have in their real life as you call it (btw. usenet is
part of the real life, believe it or not)? They have a
problem, ask and discuss, sometimes even learning something
during the discussions and be glad afterwards that they
were able to solve their problems. Perhaps they even have
learned something that helps them to avoid problems or
errors of similar categories in the future?

Markus, score adjusted
Jan 3 '06 #30
nelu said:

Kenny McCormack wrote:
You, also, need to get some help in learning to distinguish between
Usenet and real life.


Even when a lot of people apply what they learn on Usenet in real-life?


You need to learn to distinguish between Kenny McCormack and a person
genuinely interested in, and capable of learning from, your answer.

--
Richard Heathfield
"Usenet is a strange place" - dmr 29/7/1999
http://www.cpax.org.uk
email: rjh at above domain (but drop the www, obviously)
Jan 3 '06 #31
ga*****@yin.interaccess.com (Kenny McCormack) writes:
In article <dp**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com>,
Richard Heathfield <in*****@invalid.invalid> wrote:
(The usual RH psychobabble - deleted)
(Then clayne says)
But hey, it's that important to be right, right?


It can be, yes, when lives are at stake. Badly-written code can kill people.

[snip]

___________________
/| /| | |
||__|| | Please do |
/ O O\__ NOT |
/ \ feed the |
/ \ \ trolls |
/ _ \ \ ______________|
/ |\____\ \ ||
/ | | | |\____/ ||
/ \|_|_|/ \ __||
/ / \ |____| ||
/ | | /| | --|
| | |// |____ --|
* _ | |_|_|_| | \-/
*-- _--\ _ \ // |
/ _ \\ _ // | /
* / \_ /- | - | |
* ___ c_c_c_C/ \C_c_c_c____________

--
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.
Jan 3 '06 #32
Kenny McCormack wrote
(in article <dp**********@yin.interaccess.com>):
In article <dp**********@nwrdmz02.dmz.ncs.ea.ibs-infra.bt.com>,
Richard Heathfield <in*****@invalid.invalid> wrote:
(The usual RH psychobabble - deleted)
(Then clayne says)
But hey, it's that important to be right, right?
It can be, yes, when lives are at stake. Badly-written code can kill people.


You need to learn how to distinguish between Usenet and real life.


And also to recognize when they intersect.
When you can show me where the contents of a Usenet post affect life/death
in the real world (i.e., not in the funny little online world), then we'll
talk, OK?


Simple: Post the source code to a virus here. The real world
will stand up and take notice.

More obscure way: Fail to teach students properly, they go to
Usenet to get help, they get bad advice, then graduate anyway,
go on to employment in a nuclear power plant, on missile
guidance systems, space shuttle management software, etc.
People die.

--
Randy Howard (2reply remove FOOBAR)
"The power of accurate observation is called cynicism by those
who have not got it." - George Bernard Shaw

Jan 3 '06 #33
nelu wrote:
Companies like Siemens use C in a lot of programs used in cars and
airplanes, some of them in vital places. There are a lot of cases of
tragedies (cars and planes) related to badly written code (even C).


Hate to break it to you, but they aren't coming to comp.lang.c for code
auditing. Neither are the R+D crew of nuclear reactors and air traffic
control management software.

Jan 4 '06 #34

clayne wrote:
Hate to break it to you, but they aren't coming to comp.lang.c for code
auditing. Neither are the R+D crew of nuclear reactors and air traffic
control management software.

Oh, I forgot that those people are born with special mutations that
make them C gurus before they get out of the womb.
Maybe rocket scientists don't come here, but there's a chance that some
of them were here before becoming rocket scientists... and maybe
someone who will become a rocket scientist is already here, trying to
learn and getting incomplete information because they were not directed
to the specialists.
You probably know a lot about rockets to help with an answer, but, if
you are wrong, how many people in here are going to correct you?
And errors propagate exponentially... even if they can't. :-)

Jan 4 '06 #35
Keith Thompson wrote:
___________________
/| /| | |
||__|| | Please do |
/ O O\__ NOT |
/ \ feed the |
/ \ \ trolls |
/ _ \ \ ______________|


Self-important guy, it's not trolling. We're bringing up valid issues
with valid content and dispute. Just because you fail to agree with or
recognize observations outside of your own
little world does not mean they can be automatically written off as
"trolls trolling." But I understand - it's intellectually easier for
you to cast off that which you don't agree with. All part of that
asperger's thing again, I guess.

Jan 4 '06 #36
Markus Becker wrote:
They have a
problem, ask and discuss, sometimes even learning something
during the discussions and be glad afterwards that they
were able to solve their problems. Perhaps they even have
learned something that helps them to avoid problems or
errors of similar categories in the future?

Markus, score adjusted


Because typically the answers are snide, strident, and self-important -
with a subtle goal of the regulars trying to out-correct/identify
mistakes of others. There's typically not much pragmatism exercised and
answers are full of implied perfectionism.

Jan 4 '06 #37
In article <11********************@g14g2000cwa.googlegroups.c om>,
clayne <cl****@anodized.com> wrote:
Because typically the answers are snide, strident, and self-important -
with a subtle goal of the regulars trying to out-correct/identify
mistakes of others. There's typically not much pragmatism exercised and
answers are full of implied perfectionism.


Well, this -is- comp.LANG.c . It might be different if it were
comp.PROGRAMMING.c .
--
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
Jan 4 '06 #38
Walter Roberson wrote:
Because typically the answers are snide, strident, and self-important -
with a subtle goal of the regulars trying to out-correct/identify
mistakes of others. There's typically not much pragmatism exercised and
answers are full of implied perfectionism.


Well, this -is- comp.LANG.c . It might be different if it were
comp.PROGRAMMING.c .
--
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


And what verse of the bible quotes: "Thou shalt have right to be snide
asshole if posting to comp.lang.* but thou shalt exercise the restraint
of the holy one if stricken by the filth of comp.programming.*" ? I
think that's in Ecclesiastes somewhere as well.

Jan 4 '06 #39
clayne wrote:
But I understand - it's intellectually easier for you to cast off
that which you don't agree with. All part of that asperger's thing
again, I guess.


Asparagus?
Jan 4 '06 #40

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

Similar topics

6
by: Tony Proctor | last post by:
Hi everyone We're experiencing some serious anomalies with the scheduling of ASP threads. I'd be interested to hear if anyone knows what algorithm is used (e.g. simple round-robin, or something...
7
by: Ivan | last post by:
Hi I have following problem: I'm creating two threads who are performing some tasks. When one thread finished I would like to restart her again (e.g. new job). Following example demonstrates...
20
by: Doug Thews | last post by:
I ran into an interesting re-pain delay after calling the Abort() method on a thread, but it only happens the very first time I call it. Every time afterward, there is no delay. I've got a...
6
by: Tomaz Koritnik | last post by:
I have a class that runs one of it's method in another thread. I use Thread object to do this and inside ThreadMethod I have an infinite loop: While (true) { // do something Thread.Sleep(100);...
13
by: Bob Day | last post by:
Using vs2003, vb.net I start a thread, giving it a name before start. Code snippet: 'give each thread a unique name (for later identification) Trunk_Thread.Name = "Trunk_0_Thread" ' allow...
4
by: fred | last post by:
I use a Synclock in a secondary thread and also stop the thread using the abort method. If the abort occurs while the thread is in the Synclock will the SyncLock always be released before the...
51
by: Hans | last post by:
Hi all, Is there a way that the program that created and started a thread also stops it. (My usage is a time-out). E.g. thread = threading.Thread(target=Loop.testLoop) thread.start() ...
14
by: joey.powell | last post by:
I am using VS2005 for a windows forms application. I need to be able to use a worker thread function to offload some processing from the UI thread. The worker thread will need access to a...
7
by: Sin Jeong-hun | last post by:
Hi. I'm writing a Client/Multi-threaded Server program on Windows Vista. It worked fine on Windows Vista, but when the server ran on Windows XP, I/O operation has been aborted because of either...
34
by: Creativ | last post by:
Why does Thread class not support IDisposable? It's creating quite some problem. Namely, it can exhaust the resource and you have not control over it.
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.