what's a callback?

On Tue, 21 Dec 2004 04:14:31 +0000, Rich Grise wrote:

On Mon, 20 Dec 2004 12:16:38 -0500, Boris Mohar wrote:
On Sun, 19 Dec 2004 20:36:53 -0500, Spehro Pefhany
...
http://www.tulsascots.com/photos/haggis.jpg
http://haradakun.cool.ne.jp/shashin/haggis.jpg



Looks like a giant maggot.. Fancy some geoduck?

http://www.quitbuddies.org/Qb/geoduck.jpg


I thought it was goeduck.
And I was wrong. :)

According to my local dictionary, it's just geo-duck, like geocities.
Unless it's supposed to be a hard "g", as in "gooey".

Thanks!
Rich
 
John Larkin wrote:

A few programmers I've known have used the term "callback", which
somehow related to executing a deferred subroutine or something. Does
anybody know anything about this term or its conventions? If I google
it, I just get a lot of telephone-type references.
A callback is a function call to a fuction that at design
time does not yet exist.

Rene
--
Ing.Buero R.Tschaggelar - http://www.ibrtses.com
& commercial newsgroups - http://www.talkto.net
 
"Rene Tschaggelar" <none@none.net> wrote in message
news:41c808c4$0$30029$5402220f@news.sunrise.ch...
A callback is a function call to a fuction that at design
time does not yet exist.
What a strange thread. Full of misinformation such as this.

Steve
http://www.fivetrees.com
 
Steve at fivetrees wrote:
"Rene Tschaggelar" <none@none.net> wrote in message
news:41c808c4$0$30029$5402220f@news.sunrise.ch...

A callback is a function call to a fuction that at design
time does not yet exist.


What a strange thread. Full of misinformation such as this.
Ah yes? All callbacks I worked with involved function whichs
specs were defined roughly but not implemented yet.
The proceedings involved writing this function and supplying
a pointer to it to the already existing code.
No?

Rene
 
On Sun, 19 Dec 2004 21:50:21 GMT, Anthony Fremont wrote:

"Fred Bloggs" <nospam@nospam.com> wrote in message

No- that is called "setting a flag to remind you to finish some
chores"
and is an example of *re-entrant code*:) Why in the world would that
be
called "callback" unless you collect useless jargon?

That's certainly the most unique definition of re-entrancy that I've
seen.

When I think of re-entrant code, I think of code that has no local
variable storage associated to it. I also think of code that can call
itself recursively or be executed in several threads across multiple
processors concurrently with only one copy in memory.
That's called static linking.

--
Best Regards,
Mike
 
On Sun, 19 Dec 2004 14:04:30 -0800, John Larkin wrote:

On Sun, 19 Dec 2004 21:50:21 GMT, "Anthony Fremont"
spam@anywhere.com> wrote:


"Fred Bloggs" <nospam@nospam.com> wrote in message

No- that is called "setting a flag to remind you to finish some
chores"
and is an example of *re-entrant code*:) Why in the world would that
be
called "callback" unless you collect useless jargon?

That's certainly the most unique definition of re-entrancy that I've
seen.

When I think of re-entrant code, I think of code that has no local
variable storage associated to it. I also think of code that can call
itself recursively or be executed in several threads across multiple
processors concurrently with only one copy in memory.

AKA "pure" code.

Reentrant code means that a program can have more than one thread
executing concurrently.

http://vergil.chemistry.gatech.edu/resources/programming/threads.html

--
Best Regards,
Mike
 
On Mon, 20 Dec 2004 01:37:23 -0500, Mike Monett wrote:

John Larkin wrote:

A few programmers I've known have used the term "callback", which
somehow related to executing a deferred subroutine or something. Does
anybody know anything about this term or its conventions? If I google
it, I just get a lot of telephone-type references.

I'm doing a thing now where, in an interrupt service routine, if I
think I'm out of time I set a flag to remind me to finish some chores
next time or so. I'm not sure if that qualifies as a "callback."

John

That's a flag. Here's a good explanation of callbacks:

http://www.tutok.sk/fastgl/callback.html

Ah. Thanks. I didn't stop to think that templates are the way to
deal with unknown return types. Problem is that you can't actually
use that kind of function without passing the type as a template
parameter.

I had a prob with a template in a dll. It wouldn't link because the
implementation wasn't there.

Like

dll header
template class <T> MyClass{}

The program wouldn't link because there was no implementation.

I couldn't declare

MyClass myClass<int>;
--
Best Regards,
Mike
 
On Tue, 21 Dec 2004 19:00:52 GMT, Anthony Fremont wrote:

"Active8" wrote:
On Sun, 19 Dec 2004 21:50:21 GMT, Anthony Fremont wrote:

When I think of re-entrant code, I think of code that has no local
variable storage associated to it. I also think of code that can
call
itself recursively or be executed in several threads across multiple
processors concurrently with only one copy in memory.

That's called static linking.

Not as I understand things. Static linking is when you satisfy all
external references at compile/link time, incorporating all the library
routines right into your bound executable.
Yup. I'm still talking of static storage but thinking of linking.

<snip>
--
Best Regards,
Mike
 
"John Larkin" <john@spamless.usa> wrote in message

My (perhaps non-professional-programmer) definition of that is
"relocatable" or "PIC" (position independent) code.
Yes, PIC is more common it seems. I come from the less popular
GE/Honeywell/Bull background. Actually, the GE part was a little (and I
do mean little) before my time.

"Pure" code is code that has no associated statics and if of course
not self-modifying, so that it can be executed by multiple threads
without hassle.
You are right, of course. ;-)
 
Frank Bemelman wrote:
[...]
90% of the responses were pretty much okay. That is not 'Full
of misinformation'.
That number is getting smaller as the thread gets longer.

[...]
 
On Wed, 22 Dec 2004 05:00:37 -0000, "Steve at fivetrees"
<steve@NOSPAMTAfivetrees.com> wrote:


Which returns me to the deliberate brevity of my first post. What *is* going
on here? This thread has redefined not only callbacks, but "static",
re-entrancy, and the value of Pi [1]. The guys here in comp.arch.embedded
usually really know their stuff... ("bunch of arrogant, boring wannabees as
they are" ;).) Are we being cross-contaminated by sci.electronics.design? Is
it all their fault? [2]

[1] I lied about Pi.
[2] Our newsgroup is better than yours. Rrrrrasp!!
No, it's my fault. I should have remembered that embedded programmers
and electrical engineers never talk.

John
 
Fred Bloggs <nospam@nospam.com> wrote in news:41C5F993.9090009
@nospam.com:

Anthony Fremont wrote:
"Fred Bloggs" <nospam@nospam.com> wrote in message


No- that is called "setting a flag to remind you to finish some

chores"

and is an example of *re-entrant code*:) Why in the world would that

be

called "callback" unless you collect useless jargon?


That's certainly the most unique definition of re-entrancy that I've
seen.

When I think of re-entrant code, I think of code that has no local
variable storage associated to it. I also think of code that can call
itself recursively or be executed in several threads across multiple
processors concurrently with only one copy in memory.


I am not going to quibble with your high level semantics- if the code
can be re-entered to perform its processing to completion then it is
re-entrant, period. I am not interested into any universal
all-encompassing definitions. It is a *simple* ISR.
No, re-entrant code has a specific definition, that is not it, others
have covered it well enough in this thread.

--
Richard
 
john jardine wrote:
[...]

Oh, how loudly wintel laugh on their way to the bank.
What honestly puzzles me though is, how have the computing/programming
industries avoided natural selection forces over the past 10-20 years?.
The present monopoly situation would like it that way but it seems only a
part answer. Where have all the free thinkers gone. The radicals. The
companies/individuals who can spot major failings and grab an opportunity?.
[...]

regards
john
Microsoft has peaked and can only lose market share to Linux. Open Source is
becoming a viable business model. Things are improving, but remember, Rome
wasn't burned down in a day:)

Best,

Mike Monett
 
John Larkin wrote:
A few programmers I've known have used the term "callback", which
somehow related to executing a deferred subroutine or something. Does
anybody know anything about this term or its conventions? If I google
it, I just get a lot of telephone-type references.
I'd say that it's usually used when you have some kind of OS running.
You often specify the address of a routine to be executed when some kind
of I/O is complete. The OS automatically invokes the "callback" routine
when whatever was being waited on is complete.

An interrupt handler might be deemed a callback routine, but I tend to
think of callbacks as being more of a one-off type of thing.

I'm doing a thing now where, in an interrupt service routine, if I
think I'm out of time I set a flag to remind me to finish some chores
next time or so. I'm not sure if that qualifies as a "callback."
I would call that a semaphore. (actually, I would call it a switch or a
flag; someone with more professional education, or someone in personnel
might call it a semaphore ;-)
 
In article <pan.2004.12.21.03.29.34.610515@example.net>,
Rich Grise <rich@example.net> wrote:
According to my local dictionary, it's just geo-duck, like geocities.
Unless it's supposed to be a hard "g", as in "gooey".
It is. Gooey-Duck.

Tried to dig one once, but the sucker was about three feet down under a
strata of clay on it's way to shale. Probably how it managed to survive
on a beach about 4 miles from Seattle. I was probably the 10th guy
to try to dig up that damn clam. (The commercial stuff is dug by divers
below the tide line).

Hot stuff for sushi, I hear. Didn't used to be, then some marketeer,
about 10-15 years ago, decided to boost its supposed aphrodisiac
qualities based on its appearance. (Selling stuff is what this town
is really good at. Started with those gold miners. Coffee, anyone).

Mark Zenier mzenier@eskimo.com Washington State resident
 
On Thu, 23 Dec 2004 22:53:28 +0100, "Frank Bemelman"
<f.bemelmanq@xs4all.invalid.nl> wrote:

My point is that the argument that Windows is 'bloated' doesn't hold.
I bet that there are more PIC's running (relative) bloated code than
PC's. Programmers at Microsoft aren't that stupid.
They're not stupid, but, working as a team, they do manage to produce
prodigious amounts of very bad code. After a decade of effort, they
still seem incapable of preventing buffer overflow exploits, and every
generation of Windows runs slower and is more difficult to maintain.

I've seen a bit of the Windows source code, and it's a mess. Windows
is simply bad programming.

John
 
"John Larkin" <john@spamless.usa> wrote in message
news:iveos0pou4573r7brp8qt7vmcsnsahgb2m@4ax.com...
On Thu, 23 Dec 2004 22:53:28 +0100, "Frank Bemelman"
f.bemelmanq@xs4all.invalid.nl> wrote:

My point is that the argument that Windows is 'bloated' doesn't hold.
I bet that there are more PIC's running (relative) bloated code than
PC's. Programmers at Microsoft aren't that stupid.

They're not stupid, but, working as a team, they do manage to produce
prodigious amounts of very bad code. After a decade of effort, they
still seem incapable of preventing buffer overflow exploits, and every
generation of Windows runs slower and is more difficult to maintain.

I've seen a bit of the Windows source code, and it's a mess. Windows
is simply bad programming.
Some of the people at Microsoft write very ggod books about writing
software, or managing large software projects.

I guess no one has any time to read or be trained.
 
I read in sci.electronics.design that john jardine
<john@jjdesigns.fsnet.co.uk> wrote (in <cqc9h2$6cp$1@newsg2.svr.pol.co.u
k>) about 'what's a callback?', on Wed, 22 Dec 2004:

Look at the programming groups. A well applauded answer to an obvious
question is one that is comprehensible only within higher ranks of the
priesthood and consumes at least half a ream of paper. (eg the above
callback 'paper'). There seems no individuals capable of or willing to
break rank. Why was Acrobat version 6 allowed to see daylight?. Where's
the ace programmers with a vision and a bad-arsed attitude?. I get a
distinct smell/echo of a self supporting, arts type 'philosophy'
philosophy at work.
I don't think we know for sure why the software business shows all the
signs of a species about to go extinct through spending too many
resources on lavish body decoration (read 'features that hardly anybody
will ever use'). It may be that corporate purchasing is to blame; it is
easier to get authorisation for $10 000 than for $100, because if it
costs $10 000, it MUST work, whereas for $1000 it MUST be too cheap. And
forget $100 entirely - that must be some sort of evil program that will
cause the company to collapse.

Even back in the 80s, lots of people were calling attention to the poor
quality of PC programs compared with, particularly, BBC Micro and Acorn
programs. No doubt RISC had something to do with that, but there was a
pride of achievement in producing compact code. The market for these
computers and their software appreciated that, too, because while memory
and storage were not hugely costly, funds were often very short and many
computers had minimal memory and disc capacity.

The people writing high-class compact code now seem confined to the same
freeware and shareware market sectors.
--
Regards, John Woodgate, OOO - Own Opinions Only.
The good news is that nothing is compulsory.
The bad news is that everything is prohibited.
http://www.jmwa.demon.co.uk Also see http://www.isce.org.uk
 
On 23 Dec 2004 11:24:52 -0800, pm940@yahoo.com wrote:

Every actor in LA and NY will tell you that. The majority of people on
this thread are morons.
Well, sure. What's wrong with that?

An interrupt is a low-level callback, of sorts.
But not if the vector is determined at compile time, right?

There are three types of programmer: Those who can use "callback"
without having to write an essay, those like me who will write an
essay, but still not articulate it clearly, and those who just write a
10 line "C" program so that other's go, "Oh, yeah... I see it.".
So I guess I'm not a programmer. OK.

John
 
If a cold reading, screen test or other audition is successful, you
will get a callback.

Every actor in LA and NY will tell you that. The majority of people on
this thread are morons.


Now, there's also this fringe use of the term used by "computer
programmers", whatever that means. Basically, if you call a function
with a pointer to one of your own function, such that your function
will be called at some time either synchronously (a-la qsort) or
asynchronously (a-la signal(), or interrupt or button-press) then that
target function is a callback.


An interrupt is a low-level callback, of sorts.
A POSIX signal handler is a callback, of sorts.
The qsort comparator is a callback.
Basically any "registered" or "plug-in" function call is a callback. A
callback can be used within a module or library for its own purposes or
used as a mechanism to call external functions.

A virtual function in a child class is not, by definition, a callback,
but the overall observer framework may use it like a callback, so for
example you can have a CButtonObserver class with a buttonPress()
method.

So if a framework defines a non-local control flow, where an
application's functions are called somewhat asynchronously, then
callbacks are used.

So if I pass a library a pointer to function X, but that library has no
knowledge of function X other than the fact that it now has a pointer
to it... and at some point the library calls function X, then X is a
callback. This is what I mean by non-local control flow. X is not
part of the core library implementation (a-la qsort), it's an
externally provided function.

God damn it.


There are three types of programmer: Those who can use "callback"
without having to write an essay, those like me who will write an
essay, but still not articulate it clearly, and those who just write a
10 line "C" program so that other's go, "Oh, yeah... I see it.".
 

Welcome to EDABoard.com

Sponsor

Back
Top