| Author |
Message |
Frank Bemelman
Guest
|
Posted:
Tue Dec 21, 2004 10:03 pm Post subject:
Re: what's a callback? |
|
|
"Steve at fivetrees" <steve@NOSPAMTAfivetrees.com> schreef in bericht
news:8ZCdnSRmGtzCrVXcRVn-tA@nildram.net...
| Quote: | "Frank Bemelman" <f.bemelmanq@xs4all.invalid.nl> wrote in message
news:41c81d6d$0$432$e4fe514c@news.xs4all.nl...
What a strange thread. Full of misinformation such as this.
90% of the responses were pretty much okay. That is not 'Full
of misinformation'.
Granted. However the 10% were fairly forceful ;).
Of course you don't bother to give any meaningful response
yourself. Like the majority of CAE, bunch of arrogant, boring
wannabees as they are.
CAE? not sure I know this one (other than Computer Aided Engineering).
|
It's right under your nose. You are posting in it ;)
| Quote: | Ok - meaningful response then. Rene said:
A callback is a function call to a fuction that at design time does not
yet exist.
That's one potential/peripheral/trivial use, sure (esp. once he'd provided
more detail), but it's not what defines a callback.
|
I have to admit I misread his post first too, thought for a moment he
was talking about stubs or something. But imo he was as close as
it gets.
OTH, what's in a name. All too often we see old wine in new bags.
| Quote: | More generally, a
callback is a means of providing an instance-specific hook into a
general-purpose process (a form of polymorphism, if you like). The
simplest
example I can think of is a state machine, where each state corresponds to
a
specific processing routine. You can deal with this via a case structure,
sure, but it's neater (and more robust) to use an array of function
pointers.
A more real-world example would be a class that exists to process input
from
e.g. a file. Let's say that each "item" in the file is processed by a
general-purpose handler class, but is finally validated and stored by a
routine that is specific to the nature of the item encountered. Within the
uberclass definition one could include a function pointer (the callback);
within the instance of the class one would point this at the specific
routine.
|
Perhaps I am misreading here, but this sounds not at all as callbacks.
More like down to earth routing of objects to their specific handlers.
| Quote: | Another example is a registered callback (described by others here), where
a
function pointer is passed to a class at runtime (e.g. qsort). I use
static
callbacks all the time, but registered callbacks much less so.
Hope this redresses the balance ;).
|
I don't know ;) It's getting hairier.
--
Thanks, Frank.
(remove 'q' and 'invalid' when replying by email) |
|
| Back to top |
|
 |
Active8
Guest
|
Posted:
Tue Dec 21, 2004 10:10 pm Post subject:
Re: what's a callback? |
|
|
On Mon, 20 Dec 2004 08:17:30 -0800, John Larkin wrote:
| Quote: | On Mon, 20 Dec 2004 10:12:58 GMT, "Anthony Fremont"
spam@anywhere.com> wrote:
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.
Well.....I guess if it were to be really pure code, all addresses would
have to be relative to the instruction counter. ;-) We used to call
this floatable code as it could be just plunked into memory anywhere and
executed.
My (perhaps non-professional-programmer) definition of that is
"relocatable" or "PIC" (position independent) code.
|
Right. As opposed to "absolute", IIRC.
| Quote: |
"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.
|
"Static" referes to local variables that retain their values between
calls. Static linking of a function (declared in a class
declaration) means that all instances of that class use the same
function at the same location.
My def?
Reentrant code means that a program can have more than one thread
executing concurrently.
http://vergil.chemistry.gatech.edu/resources/programming/threads.html
Eh? Kinda general really.
If you do something to modify a variable and another thread executes
the function it may or may not get a valid value. First,
"concurrently". It's an illusion for a single processor system. They
get a time slice. But when the threads pause, the code where
execution left off is reentered.
--
Best Regards,
Mike |
|
| Back to top |
|
 |
Active8
Guest
|
Posted:
Tue Dec 21, 2004 10:33 pm Post subject:
Re: what's a callback? |
|
|
On Mon, 20 Dec 2004 01:37:23 -0500, Mike Monett wrote:
| Quote: | 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 |
|
| Back to top |
|
 |
John Larkin
Guest
|
Posted:
Tue Dec 21, 2004 11:19 pm Post subject:
Re: what's a callback? |
|
|
On Tue, 21 Dec 2004 12:01:49 -0500, Active8 <reply2group@ndbbm.net>
wrote:
| Quote: | 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
|
My illustrative example is a cooking school. One big recipe is posted
on the wall, and lots of students are reading it and cooking, each at
their own pace. They maintain their own local variables, the stuff in
their pots. The code remains pure as long as nobody splashes anything
on it.
John |
|
| Back to top |
|
 |
Anthony Fremont
Guest
|
Posted:
Wed Dec 22, 2004 12:00 am Post subject:
Re: what's a callback? |
|
|
"Active8" wrote:
| Quote: | 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. This generally makes for
quite large (megabytes) executable files, but also means that the
executable contains everything necessary to run. This means people wont
have to install a bunch of libraries to be able to execute it.
This is as opposed to dynamic linking where external references are
satisfied at run-time. This is done in windows with DLL libs or in
Linux with .so libs. The executable file only contains references to
the desired routines and acceptable versions (aka stubs); a dynamic
linker pieces it all together just in the nick of time. The dynamic
linker is part of the OS. This tends to make the executables much
smaller as all that's in them is the core code of the application and a
bunch of external references (not to be confused with object files).
There is no mandate of recursion or re-entrancy other than that dynamic
library scenarios are typically done in a manner to support a single
resident copy of the code segment even with multiple threads
simultaneously executing.
Statically linked programs would usually lead to multiple copies of the
same code being in memory when multiple occurrences of the program are
in execution. It's also possible that the OS might handle two
occurrences of the same executable by using one mostly shared copy by
implementing copy-on-write to clone pages as necessary.
I guess that's my 2cents anyhoo. ;-) |
|
| Back to top |
|
 |
John Larkin
Guest
|
Posted:
Wed Dec 22, 2004 12:16 am Post subject:
Re: what's a callback? |
|
|
On Mon, 20 Dec 2004 01:37:23 -0500, Mike Monett <no@spam.com> wrote:
| Quote: | 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
Best,
Mike Monett
|
Good grief, but that's hairy stuff. No wonder Windows is such a flakey
pos. Makes me glad I program in assembly, where everything's in plain
sight.
As I now recall, the first time I encountered the "callback" concept
it was in a realtime assembly-language app. If an ISR didn't have time
to finish something, it poked a pointer to the "rest" of its code
somewhere and let the RTOS execute that later when resources were
available. DECs later OSs (RSXnn and VMS, I think) had a "fork"
facility that was similar.
John
John |
|
| Back to top |
|
 |
Active8
Guest
|
Posted:
Wed Dec 22, 2004 12:29 am Post subject:
Re: what's a callback? |
|
|
On Tue, 21 Dec 2004 19:00:52 GMT, Anthony Fremont wrote:
| Quote: | "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 |
|
| Back to top |
|
 |
Anthony Fremont
Guest
|
Posted:
Wed Dec 22, 2004 3:35 am Post subject:
Re: what's a callback? |
|
|
"John Larkin" <john@spamless.usa> wrote in message
| Quote: | 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.
| Quote: | "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. ;-) |
|
| Back to top |
|
 |
Charles W. Johson Jr.
Guest
|
Posted:
Wed Dec 22, 2004 4:56 am Post subject:
Re: what's a callback? |
|
|
"Active8" <replyt2group@ndbbm.net> wrote in message
news:fpjgs0p2oj4qugqlsb8scl8aufh1sn2rj6@4ax.com...
| Quote: | On 21 Dec 2004 14:43:13 GMT, Hans-Bernhard Broeker
broeker@physik.rwth-aachen.de> wrote:
In comp.arch.embedded Active8 <replyt2group@ndbbm.net> 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.
Not even remotely true, let alone possible to compile.
It's actually a lot more true than you believe. Rene may have
condensed its essence down to a little too few words for you to
recognize it, but he did get it right.
The function *must* exist, however you can select a function and
pass a pointer at runtime.
You can't even compile a function in C++ without an implementation.
Correct, but that's not the issue at hand. We're talking about the
not-yet-existing implementation of a _called_ function, not its
caller.
To rephrase Rene's statement: a callback is what you use if a function
'foo' needs to be written now, which has to call another function
'bar' that may not exist yet.
Something has to be declared or it won't compile. I know, that's not
a definition, just a generic function pointer. As you go on, it
becomes more clear what you're trying to say (I practiced this same
excersize with Kevin :) ) so don't feel compelled to comment on all
my comments.
More importantly, different calls to
'foo' may want to use different functions 'bar', at least some of
which aren't written yet.
That's called function overloading and another way is polymorphism.
You can't *link* a function call to a function with no definition,
If it's *declared" in a header or somewhere "in scope", it will
*compile* but if the definition hasn't been written, the linker
won't find it's entry point in any modules and it won't *link*. But
that's not a generic function pointer I'm talking about.
IOW, you can't assign a *valid* pointer at runtime unless the
function is defined somewhere.
pfunc = atan;
won't work if the linker can't find atan.
pfunc = NULL;
pfunc = atan;
function(pfunc);
groovy, now hit "execute".
So you declare the interface signature of 'bar', and make a pointer to
a function of that signature (or, in OO, an object implementing that
interface) part of the set of arguments passed to 'foo'.
As I said, I can pass any bogus pointer in a function. The fact is,
that function must have been defined (implemented) somewhere or it
won't link. At design time, not run time. You can grab a valid
pointer at runtime, but there *will be no valid pointer unless the
function was implemented and compiled in a module that the linker
can see.*
Period.
The central aspect that makes this a good idea (compared to other
methods of selecting a function to call from a collection, e.g. an
index into a table of function pointers, or a switch() between a lot
of function calls), is indeed, as Rene pointed out, that it lets you
split up "compile time" into at least two separate phases, to be
carried out by different people, at different places and times: one is
the compilation time of 'foo', the other the (potentially lots of)
compilations of 'bar', and also of the function that calls 'foo' and
passes 'bar' to it.
None of this changes the fact that it won't link. Won't even compile
without a declaration.
function(void){}
void (*pfunc) ();
function(pfunc);
This will compile and link, but if you run this code, you have to
assign a value (address) to the function pointer pfunc and you
can't get that address if it's stilll vaporware.
None of this changes the fact that this ain't the definition of a
callback function.
This is funny. I just typed __define callback function__ into
google and didn't get any returns about phones.
http://gethelp.devx.com/techtips/cpp_pro/10min/10min0300.asp
quote
A callback function is one that is not invoked explicitly by the
programmer; rather the responsibility for its invocation is
delegated to another function that receives the callback function's
address.
/quote
Period.
Even an empty function is an *implementation* of a function.
But an empty function is not part of this design --- there's just the
prototype, and a *pointer* to such a function.
where's the linker gonna get the damn valid pointer from, it's ass?
But no actual
implementation of any such function is involved in this design pattern
named "callback". That's how you can implement the pattern, without
having any implementation of the actual callback function at hand.
Good. Now click "Execute". Oh. You're waiting on another group to
implement your function? So you wrote what's known to me as a
"stub". You could just as easily write an empty function if you
don't need the flexibility of function pointers.
say
func(){}
function(func);
and the function "function" will get the pointer to func and execute
it as a "callback". It's still a callback regardless of whether it's
implemented.
-
Best Regards,
Mike
|
What normally would be defined is only the function title and type ; void
mycallback (int,int,double);
then as long as the function mycallback accepts the correct variables and
returns void it would be entered later.
Windows uses this for the WinMain function in a basic C program, Windows is
given a function name in the Window definition often called WinProc()
windows then access that procedure rather than Main() to run the program.
Charles |
|
| Back to top |
|
 |
FLY135
Guest
|
Posted:
Wed Dec 22, 2004 6:47 am Post subject:
Re: what's a callback? |
|
|
"Active8" <replyt2group@ndbbm.net> wrote in message
news:fpjgs0p2oj4qugqlsb8scl8aufh1sn2rj6@4ax.com...
| Quote: | On 21 Dec 2004 14:43:13 GMT, Hans-Bernhard Broeker
broeker@physik.rwth-aachen.de> wrote:
In comp.arch.embedded Active8 <replyt2group@ndbbm.net> 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.
Not even remotely true, let alone possible to compile.
It's actually a lot more true than you believe. Rene may have
condensed its essence down to a little too few words for you to
recognize it, but he did get it right.
The function *must* exist, however you can select a function and
pass a pointer at runtime.
You can't even compile a function in C++ without an implementation.
Correct, but that's not the issue at hand. We're talking about the
not-yet-existing implementation of a _called_ function, not its
caller.
To rephrase Rene's statement: a callback is what you use if a function
'foo' needs to be written now, which has to call another function
'bar' that may not exist yet.
Something has to be declared or it won't compile. I know, that's not
a definition, just a generic function pointer. As you go on, it
becomes more clear what you're trying to say (I practiced this same
excersize with Kevin :) ) so don't feel compelled to comment on all
my comments.
|
Correction, you mean *link* not compile. I have made quite a few libraries
that compiled perfectly fine using callback functions that did not exist.
Some of them were dynamic link libraries where the code that contained the
callback calling code never knew of the existance of any particular callback
function at compile time. Typically I would implement callback interfaces
to have both a callback function pointer and an instance variable. That way
the client code that contained the callback could have multiple instances
usually implemented as a C++ class. The instance variable would be a void*
to the library, and the client could cast it back to whatever it wanted,
which was normally the "this" pointer for whatever class type it happened to
be. |
|
| Back to top |
|
 |
Active8
Guest
|
Posted:
Wed Dec 22, 2004 6:54 am Post subject:
Re: what's a callback? |
|
|
On Tue, 21 Dec 2004 23:56:47 GMT, Charles W. Johson Jr. wrote:
| Quote: | "Active8" <replyt2group@ndbbm.net> wrote in message
news:fpjgs0p2oj4qugqlsb8scl8aufh1sn2rj6@4ax.com...
On 21 Dec 2004 14:43:13 GMT, Hans-Bernhard Broeker
broeker@physik.rwth-aachen.de> wrote:
In comp.arch.embedded Active8 <replyt2group@ndbbm.net> 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.
Not even remotely true, let alone possible to compile.
It's actually a lot more true than you believe. Rene may have
condensed its essence down to a little too few words for you to
recognize it, but he did get it right.
The function *must* exist, however you can select a function and
pass a pointer at runtime.
You can't even compile a function in C++ without an implementation.
Correct, but that's not the issue at hand. We're talking about the
not-yet-existing implementation of a _called_ function, not its
caller.
To rephrase Rene's statement: a callback is what you use if a function
'foo' needs to be written now, which has to call another function
'bar' that may not exist yet.
Something has to be declared or it won't compile. I know, that's not
a definition, just a generic function pointer. As you go on, it
becomes more clear what you're trying to say (I practiced this same
excersize with Kevin :) ) so don't feel compelled to comment on all
my comments.
More importantly, different calls to
'foo' may want to use different functions 'bar', at least some of
which aren't written yet.
That's called function overloading and another way is polymorphism.
You can't *link* a function call to a function with no definition,
If it's *declared" in a header or somewhere "in scope", it will
*compile* but if the definition hasn't been written, the linker
won't find it's entry point in any modules and it won't *link*. But
that's not a generic function pointer I'm talking about.
IOW, you can't assign a *valid* pointer at runtime unless the
function is defined somewhere.
pfunc = atan;
won't work if the linker can't find atan.
pfunc = NULL;
pfunc = atan;
function(pfunc);
groovy, now hit "execute".
So you declare the interface signature of 'bar', and make a pointer to
a function of that signature (or, in OO, an object implementing that
interface) part of the set of arguments passed to 'foo'.
As I said, I can pass any bogus pointer in a function. The fact is,
that function must have been defined (implemented) somewhere or it
won't link. At design time, not run time. You can grab a valid
pointer at runtime, but there *will be no valid pointer unless the
function was implemented and compiled in a module that the linker
can see.*
Period.
The central aspect that makes this a good idea (compared to other
methods of selecting a function to call from a collection, e.g. an
index into a table of function pointers, or a switch() between a lot
of function calls), is indeed, as Rene pointed out, that it lets you
split up "compile time" into at least two separate phases, to be
carried out by different people, at different places and times: one is
the compilation time of 'foo', the other the (potentially lots of)
compilations of 'bar', and also of the function that calls 'foo' and
passes 'bar' to it.
None of this changes the fact that it won't link. Won't even compile
without a declaration.
function(void){}
void (*pfunc) ();
function(pfunc);
This will compile and link, but if you run this code, you have to
assign a value (address) to the function pointer pfunc and you
can't get that address if it's stilll vaporware.
None of this changes the fact that this ain't the definition of a
callback function.
This is funny. I just typed __define callback function__ into
google and didn't get any returns about phones.
http://gethelp.devx.com/techtips/cpp_pro/10min/10min0300.asp
quote
A callback function is one that is not invoked explicitly by the
programmer; rather the responsibility for its invocation is
delegated to another function that receives the callback function's
address.
/quote
Period.
Even an empty function is an *implementation* of a function.
But an empty function is not part of this design --- there's just the
prototype, and a *pointer* to such a function.
where's the linker gonna get the damn valid pointer from, it's ass?
But no actual
implementation of any such function is involved in this design pattern
named "callback". That's how you can implement the pattern, without
having any implementation of the actual callback function at hand.
Good. Now click "Execute". Oh. You're waiting on another group to
implement your function? So you wrote what's known to me as a
"stub". You could just as easily write an empty function if you
don't need the flexibility of function pointers.
say
func(){}
function(func);
and the function "function" will get the pointer to func and execute
it as a "callback". It's still a callback regardless of whether it's
implemented.
-
Best Regards,
Mike
What normally would be defined is only the function title and type ; void
mycallback (int,int,double);
|
Ho hum. I gave the terminology twice already. That is not a
definition, it is a deeclaration.
| Quote: |
then as long as the function mycallback accepts the correct variables and
returns void it would be entered later.
|
I also gave the definition of a callback function and it has
absolutely nothing to do with whether the function is implemented
(defined) or vaporware.
| Quote: |
Windows uses this for the WinMain function in a basic C program, Windows is
|
Way off. The WinMain function (like main() in a DOS app) is the
application entry point which actually calls a WinMain function from
the CRT lib which has more parameters that you don't see.
| Quote: | given a function name in the Window definition often called WinProc()
^^^^^^^^^ wtf? |
No. CreateWindow() and CreateWindowEx() are called to create a
window and the WndProc callback address is passed as a parameter.
| Quote: | windows then access that procedure rather than Main() to run the program.
|
No. The OS calls this function when it needs to pass a windows
message to the WndProc so the user can process it. Every window in
an app has it's own WndProc.
--
Best Regards,
Mike |
|
| Back to top |
|
 |
Scott Stephens
Guest
|
Posted:
Wed Dec 22, 2004 7:58 am Post subject:
Re: what's a callback? |
|
|
John Larkin wrote:
| Quote: | 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."
|
I wouldn't call it a callback. If you are instancing a bunch of objects,
you pass them a function (java-method) pointer (java-instance variable)
so they can activate a function in the instancing routine.
For instance, I have a software scope, I push a button to instance a
plot, and pass each plot-object an instance of a trace object-variable
(pointer), and a handle or pointer to the main scope program which
refreshes it.
What your talking about sounds like a flag. Unless you are doing
object-oriented programming on microcontrollers =) |
|
| Back to top |
|
 |
Mike Monett
Guest
|
Posted:
Wed Dec 22, 2004 7:58 am Post subject:
Re: what's a callback? |
|
|
John Larkin wrote:
| Quote: | Here's a good explanation of callbacks:
http://www.tutok.sk/fastgl/callback.html
Best,
Mike Monett
Good grief, but that's hairy stuff. No wonder Windows is such a flakey
pos. Makes me glad I program in assembly, where everything's in plain
sight.
|
[...]
Yes, assembly rocks. High level languages don't let you see what is
actually happening in the registers, so you miss good ways to optimize
the code. Although I prefer to let a good HLL to handle most of the
interface stuff, and focus my attention on the places where assembly can
really pay off in performance.
Another thing - it's amazing what can be accomplished in a few hundred
bytes of assembly. So how on earth can Windows consume hundreds of
megabytes to do basically the same thing? I mean, when a printer driver
requires 600 megabytes, something is seriously broken. There's no way a
cpu could be executing all that code all the time - in fact, there is
nothing that could possibly be that complex. So what is the reason for
the bloat???
Best,
Mike Monett |
|
| Back to top |
|
 |
Bryan Hackney
Guest
|
Posted:
Wed Dec 22, 2004 7:58 am Post subject:
Re: what's a callback? |
|
|
Frank Bemelman wrote:
[...]
| Quote: | 90% of the responses were pretty much okay. That is not 'Full
of misinformation'.
|
That number is getting smaller as the thread gets longer.
[...] |
|
| Back to top |
|
 |
Steve at fivetrees
Guest
|
Posted:
Wed Dec 22, 2004 7:58 am Post subject:
Re: what's a callback? |
|
|
"Frank Bemelman" <f.bemelmanq@xs4all.invalid.nl> wrote in message
news:41c8572c$0$1146$e4fe514c@news.xs4all.nl...
| Quote: |
CAE? not sure I know this one (other than Computer Aided Engineering).
It's right under your nose. You are posting in it ;)
|
Ah. Touché. <embarrassed shuffle>
| Quote: | I have to admit I misread his post first too, thought for a moment he
was talking about stubs or something. But imo he was as close as
it gets.
|
Hmmm. Will read again. I also thought he was talking about stubs. It's not
at all impossible that I'm missing something.
| Quote: | OTH, what's in a name. All too often we see old wine in new bags.
|
I'm with you. I've re-read my own definition, don't like it much, and am
regretting getting involved ;).
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!!
Steve
http://www.fivetrees.com |
|
| Back to top |
|
 |
|
|
|
|