• Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

Doomed.

zeitghost

More fingers than teeth
Joined
Jul 6, 2005
Messages
35,983
Likes received
2,999
Thanks received
1,077
One of the esteemed customers just mentioned using interrupts in his PIC program.

:suicide:

This is the oik who can't get polling to work.

:suicide:
 
Get them to implement threads :throw:
 
One of the esteemed customers just mentioned using interrupts in his PIC program.

:suicide:

This is the oik who can't get polling to work.

:suicide:

Isn't interrupts a kind of polling anyway?

Or did I just "Whoooooooooosh" that. :facepalm:
 
Isn't interrupts a kind of polling anyway?

Or did I just "Whoooooooooosh" that. :facepalm:

Very much whoosh :ohwell

Polling means the code occasionally has a look to see if a condition has occurred and, if so, does something about it.

An interrupt involves the hardware, upon entering a certain state, sending a signal to the processor which causes it to stop whatever code it might happen to be executing at that instant, save its state, and go off and execute a special chunk of code designated for that purpose, called the interrupt handler. Once it returns from the interrupt handler, the processor restores its state, and goes back to whatever it was in the middle of when interrupted.

In pseudocode: polling is like

Code:
.main 
        doSomething
        doSomethingElse
        if thingHasHappened:
            doSpecialThing        # always happens here, implying known state after things done
        goto .main

whereas interrupt-driven is like

Code:
.interruptHandler
    doSpecialThing
    returnFromInterrupt

.main 
        doSomething           # interrupt could happen here
        doSomethingElse       # or here
        doThirdThing          # or here
        doFourthThing         # anywhere, really - state could be anything
        goto .main
 

Advertisers

Back
Top