what's a callback?

Ho hum. I gave the terminology twice already. That is not a definition, it is a deeclaration.

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.

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.

^^^^^^^^^ wtf?

No. CreateWindow() and CreateWindowEx() are called to create a window and the WndProc callback address is passed as a parameter.

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
Reply to
Active8
Loading thread data ...

Frank Bemelman wrote: [...]

That number is getting smaller as the thread gets longer.

[...]
Reply to
Bryan Hackney

Ah. Touché.

Hmmm. Will read again. I also thought he was talking about stubs. It's not at all impossible that I'm missing something.

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

formatting link

Reply to
Steve at fivetrees

[...]

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

Reply to
Mike Monett

No, it's my fault. I should have remembered that embedded programmers and electrical engineers never talk.

John

Reply to
John Larkin

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 =)

Reply to
Scott Stephens

Yeah, this is snipped from the "tutok" web page you referenced...

MemberTranslator1(Callee &c,const MemFunc &m): Functor1(thunk,&c,&m,sizeof(MemFunc)){} static void thunk(const FunctorBase &ftor,P1 p1) { Callee *callee = (Callee *)ftor.callee; MemFunc &memFunc(*(MemFunc*)(void *)(ftor.memFunc)); (callee->*memFunc)(p1); } };

OK, imagine trying to understand and maintain 100 millions lines of code like this. If you passed it through triple-DES encryption, it couldn't look much worse.

John

Reply to
John Larkin

Isn't that called an interface? Aren't MS COM objects (such as dhtml Active-X objects) an example of such? The COM object interface are pointers to an object-specific array of pointers.

Reply to
Scott Stephens

... snip ...

Largely C++ and templates. Also linkage generally simply grabs monster blobs, regardless of whether called or not.

--
Chuck F (cbfalconer@yahoo.com) (cbfalconer@worldnet.att.net)
   Available for consulting/temporary embedded and systems.
     USE worldnet address!
Reply to
CBFalconer

"John Larkin" schreef in bericht news: snipped-for-privacy@4ax.com...

Well, you write, test, approve and forget ;) Most of the code is pretty harmless and straight forward anyway.

There's a lot of things behind the scenes. Nobody is amazed when he/she hits the print button and a printer dialog pops up. And I have no idea how *your* printer dialog looks like. And neither has a windows application, when it happens. And the printer driver has no idea where your printer is, at lpt1, com2, usb or somewhere on your ethernet network. And of course you expect a gentle warning that it might be turned off, or has run out of paper or ink. And you want to run it from 7 applications at the same time, each using different papersizes, while your secretary wants the same printer to print a sheet of labels that she has put in the manual feed tray...

That is just one example. It is a lot easier to write robust code for a full featured pinball machine.

--
Thanks, Frank.
(remove 'q' and 'invalid' when replying by email)
Reply to
Frank Bemelman

Steve at fivetrees" schreef in bericht news: snipped-for-privacy@nildram.net...

going

as

Is

SED is a mess, and a jolly one at that, so a bit of cross-contamination won't hurt. I got a bit pissed by CBfalconer plonking Genome, SED's mascotte. The folks at CAE could loosen up a bit, increasing their value at the same time. Speff even dropped CAE in his follow-ups from a few subthreads in this one, never seen him do that on SED. The atmosphere at CAE is of the arrogant, boring wannabees etc.

;)

--
Thanks, Frank.
(remove 'q' and 'invalid' when replying by email)
Reply to
Frank Bemelman

The silly thing is that the thread has 'run off' into a whole variety of code areas not associated with a callback at all... A 'callback', is exactly what it says, and comes from the useage on the telephone, where you ring somebody, and they say they will 'call back'. There are a number of reasons. The first would be the obvious one (I'll call back, when I have the answer). The advantage here is it removes the need for an 'interrupt' signal to give a fast response, or a polling process to monitor the response of the subroutine. It can also be used for a security application (just as on the phone, where your bank 'calls back', to verify that they are talking to the person expected). This is rare in PC applications, but is quite common in some other OS's, but can be used on the PC, so that the 'callback', is operating at a different security level to the calling code. There is also the 'billing' reason (as in the phone call, where you call somebody, and they say they will 'call back', so that the charges go onto their account). In the computer version, this allows the 'callback', to be using time from the subroutine process, rather than from the main code. Again this could be at a different priority to the calling routine.

Best Wishes

Reply to
Roger Hamlett
[...]

100 million lines? Sad, but Windows is probably getting close.

I think part of the reason for code bloat is programmers have no restrictions on their code size or performance requirements. They should be given 200MHz Pentium computers with an 8 gig hard drive and 64 megs of ram. That would fix slow, bloated code real fast.

For example, my editor uses Borland SPRINT, which was last released in 1988 and was designed to run on an 8080 with 640k of ram. It handles 11 different types of files, including html, plain ascii, pascal, c, assembly, email, newsgroup postings, google groups, etc.

It can load up to 27 files simultaneously and automatically detects the file type when switching from one window to the next. It switches the command functions as appropriate for the type of file, so I don't have to memorize different commands and keystrokes depending on the file type in the current window.

The editor is very compact and and loads instantly. It rarely crashes, except when Windows crashes on a bad pointer and messes up memory. It is blazingly fast on a 200MHz Pentium, so there is little need for a 2GHz machine (except to read those #$%@&* Adobe pdf files:)

Of course, this style of thinking would probably put a lot of programmers and maybe some companies out of business. For some strange reason, making things overly complex is good for business.

Best,

Mike Monett

Reply to
Mike Monett

"Mike Monett" schreef in bericht news: snipped-for-privacy@spam.com...

Windows isn't bloated at all. There's just a lot of things to be dealt with, but that happens so incredibly transparent to the casual observer, that we take it all for granted and assume the code is bloated or something.

[snip]

This style of thinking would probably kept us all back in 1988, the release date of your editor ;)

--
Thanks, Frank.
(remove 'q' and 'invalid' when replying by email)
Reply to
Frank Bemelman

That might be understandable if you didn't also managed to indirectly insult other contributors, who posted well before the 20th when you posted this:

*only*

No netlag excuse here.

--
Thanks, Frank.
(remove 'q' and 'invalid' when replying by email)
Reply to
Frank Bemelman

No, that's just code.

Re-entrant code can be run from multiple threads, and are not dependent upon one thread running the code to completion before the other thread can run the same code.

Typically re-entrant code has no side-effects, and no static variables. Everything modified typically is in registers or on the stack, (or perhaps passed as a parameter by the caller).

All ISRs should be re-entrant, though they needn't be, if you control your interrupt sources.

Re-entrant code isn't simply an ISR. When threads are swapped preemptively, any routine that could be interrupted and called by another thread needs to be re-entrant.

I guess that's the same thing I said in the first paragraph.

Rufus

Reply to
Rufus V. Smith

Your newsreader is distorting your view of the world, I think. In a properly threaded view of this thread, this message by Mr. Falconer

which has you so upset is about the *6th* in the entire thread (and 4 levels deep) not the 20th. If it's 20th in yours, that means you're using inappropriate tools, and should be very careful using their results as arguments.

Terminally sick newsreaders are even less of one. Just because Web-based "forums" that so many newbies prefer over USENET generally don't manage to get this anywhere nearly right, doesn't mean we should degrade USENET in a similar way.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

"Hans-Bernhard Broeker" schreef in bericht news: snipped-for-privacy@news.dfncis.de...

I was referring to the date, 20th December, not the place or level in the thread. Other contributions were posted on the 19th.

I don't like those web forums too, for exactly the same reasons.

--
Thanks, Frank.
(remove 'q' and 'invalid' when replying by email)
Reply to
Frank Bemelman

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?.

For example. Selection pressure works in the electronics industry and these groups. A well applauded answer/solution to some need or discussion on a complex requirement, would be one that involves great elegance, subtlety, vast knowledge and ends up using just a few transistors and a diode. Anyone can enjoy the result, few can appreciate the process of getting there.

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.

regards john

Reply to
john jardine

There's a difference between doing something because it can be done and doing something because it's needed. Microsoft can throw the problem of hardware resources over the wall to the users at no cost to themselves.

This is precisely the thinking that's needed and necessary for /embedded/ computing. Reliability and hardware resources are directly impacted by keeping things as simple as possible.

Reply to
Everett M. Greene

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.