Program, Interrupted - Computerphile

Поділитися
Вставка
  • Опубліковано 9 лют 2025
  • In day to day life interruptions are annoying, but in computing they're essential. James Fowkes explains using an Arduino.
    EXTRA BITS: • EXTRA BITS: Program, I...
    Dijkstra's Algorithm: • Dijkstra's Algorithm -...
    Thanks to Nottingham Hackspace
    / computerphile
    / computer_phile
    This video was filmed and edited by Sean Riley.
    Computer Science at the University of Nottingham: bit.ly/nottscom...
    Computerphile is a sister project to Brady Haran's Numberphile. More at www.bradyharan.com

КОМЕНТАРІ • 262

  • @jamesadfowkes
    @jamesadfowkes 8 років тому +254

    At a few points in this video I said "8 bytes" where I meant "8 bits". Damn it all.

    • @jamesadfowkes
      @jamesadfowkes 8 років тому +56

      I got nervous and talked too fast.

    • @iAmTheSquidThing
      @iAmTheSquidThing 8 років тому +70

      +James Fowkes You did seem a bit nervous. But you also seem like a natural teacher who answers questions very clearly. Talking to a camera is always weird and unnerving to begin with.

    • @Shockszzbyyous
      @Shockszzbyyous 8 років тому +10

      don't worry it happens to everyone :D

    • @arooobine
      @arooobine 8 років тому +3

      Don't worry I had the video playing at double speed anyway so I just blamed the fast talking on that. ;)

    • @user-iu1xg6jv6e
      @user-iu1xg6jv6e 8 років тому +1

      I hope it's not you who subscribed to feministfrequency channel.

  • @anon8109
    @anon8109 8 років тому +236

    - Knock knock!
    + Who's there?
    - The interrupting interrupt.
    + The interru...
    - Just a sec while I deal with something that's suddenly come up.
    - ...
    - Please proceed.
    + pting Interrupt who?

    • @thinkfast8662
      @thinkfast8662 8 років тому +3

      HAHAHAH BEST JOKE OF 2017 OMG VERY FUNNY JOHN

    • @umnikos
      @umnikos 8 років тому +1

      Very funny summary of the video

    • @arooobine
      @arooobine 8 років тому +3

      Give this person a cookie!!!

    • @adamkatav9752
      @adamkatav9752 5 років тому +1

      This is what STI instruction is for

    • @HECKproductions
      @HECKproductions 4 роки тому +2

      that is literally genius

  • @grantmagee
    @grantmagee 8 років тому +40

    Goodness! I'm working on a digital art Arduino installation and that attachInterrupt function was EXACTLY what I needed to finish my work. Your timing on this video could not have been more perfect. Thank you kindly!

  • @69k_gold
    @69k_gold 2 роки тому +19

    I love the fact that James actually showed human demonstration of interrupts throughout the video

  • @DinoWinoSaur
    @DinoWinoSaur 8 років тому +8

    I just learnt this yesterday in my OS class. Awesome.

  • @firepower01
    @firepower01 Рік тому +3

    This is a great demonstration. Definitely helped me understand this concept better.

  • @DataCab1e
    @DataCab1e 8 років тому +26

    Show of hands: Who else remembers the days of manually configuring IRQs when installing PC hardware?

  • @ze_rubenator
    @ze_rubenator 8 років тому +60

    Interrupts are no longer part of Magic The Gathering. They were initially "faster" than instants, but it lead to a whole lot of confusion, so they were scrapped in favour of a stack system.

    • @jort93z
      @jort93z 8 років тому +2

      man i miss the good old "play as an interrupt."

    • @AndersGustafsson87
      @AndersGustafsson87 8 років тому

      Ze Rubenator The blue countetspell deck i no longer viable eh?

    • @ze_rubenator
      @ze_rubenator 8 років тому +2

      Sure it is, you just have to play the interrupts as if they were
      instants. I believe Counterpell, Power Sink and other cards like them
      are still being printed as instants.

    • @BloCKBu5teR
      @BloCKBu5teR 8 років тому

      Add 3 mana of any single color to your mana pool. Tapping this artifact can be played as an interrupt aether revolt is awesome btw

    • @Triantalex
      @Triantalex Місяць тому

      ??

  • @lunaeclipse5768
    @lunaeclipse5768 2 роки тому +1

    i remembered the moment, when i was playing video game, dota2
    then my friend plugged his usb drive for charging his phone, then its start to say "Hello, Interrupt"
    i was so angry at that time

  • @George__4l5a
    @George__4l5a 6 місяців тому

    Playfully, congratulations, your Sales Incentive payment confirmation is officially through the magical processing chamber!

  • @golarac6433
    @golarac6433 7 років тому +4

    interupts were heavely used in 8 bits systems. For example, on a NES or C64 you didn't have to check for collision between sprites, the video chip can cause an interrupt when it draws 2 sprites and they overlap

  • @Dracolith1
    @Dracolith1 8 років тому +2

    Interruptions of interruptions happen in real-life all the time..... You hear a knock at your door, then on the way to your door your kid jumps out in front of you and starts whining.

    • @karlosdaniel6537
      @karlosdaniel6537 3 роки тому +1

      That's why the interrupts may have relative priorities.

  • @DataStorm1
    @DataStorm1 8 років тому +1

    the 500ms "delay" loop, means that the button cannot be read during that 500ms, hence it not always responding, for it was inside the 500ms loop.

    • @hellterminator
      @hellterminator 8 років тому +2

      Thanks for repeating what was said in the video!

  • @orrinnaylor3681
    @orrinnaylor3681 8 років тому +1

    Fantastic. Programming tip videos like this are awesome. I would love to see more of them.

  • @probE466
    @probE466 8 років тому +4

    5:54 : It very much does not save anything in registers, you push your registers on the stack, build a new stackframe, and then execute your code.

  • @stub1116
    @stub1116 8 років тому +4

    Nice video, but how does the cpu react with Non-Maskable-Interrupts, when compared to programmable interrupts?

  • @joker28666
    @joker28666 8 років тому

    its ironic that you interrupted him saying why you dont want an interrupt to an interrupt at the end of the video, kind of wanted to know. But really useful video!

  • @romanemul1
    @romanemul1 8 років тому +58

    I wish to see video about pointers

    • @cgme7076
      @cgme7076 8 років тому +1

      romanemul1 :: Pointers are to access memory, and are a programming concept, not really a concept these guys will upload on. They cover broader topics. Here's a quick intro to points.
      On the left side of an equals sign, when declaring the name of a variable, give the variable the asterisk sign to tell the compiler you want to create a pointer (this will create a variable that can store the address of another variable or the value at that location): looks like: int* p = *anotherVar;
      then, on the other side of the equals sign, the asterisk means "address of" which gives you the literal adress of the variable on the disk: int *myP = *variableAlreadyDeclared
      the ampersan sign is used on the left side, if you are creating a "reference to" variable. what this does, is mimicks the address and value of another variable: int &referenceVar = myVariable (no asterisk for declaration, only variable name)
      now, the ampersan on the other side of the equals sign, is for getting the value, at a memory location. so if you get the address in a previous declaration, all you have to do is use the ampersan, and the value from that address will be stored in this variable:
      recent declaration: int *myPointer = *anotherVariable;
      new declaration: int myCopiedValue = &(myPointer);
      This may look very confusing, so go online and see if you can find an in-depth tutorial (I've found many, so it should be too hard)... HOPE THIS HELPED!

    • @KaedennYT
      @KaedennYT 8 років тому +3

      CGMe: I think you have it backwards. & is address-of, * is dereference.
      int x = 4;
      int* ptr_to_x = &x; // Make a pointer to x
      int copy_of_x = *ptr_to_x; // Copy the value of x to copy_of_x

    • @kaizen9451
      @kaizen9451 8 років тому

      I was suspicious of the syntax int* p = * anotherVar and tried to compile under Visual Studio 2015 - Visual C++ 19.0 and failed. As far as I'm aware, the legal syntax for pointer declaration and initialization is int* p = &anotherVar?
      *anotherVar is not "address of", & is. In using *anotherVar, you are deferencing the pointer i.e. requesting the value pointed to by 'anotherVar'. But since 'anotherVar' isn't even a pointer you'll get compiler warnings.
      Edit: I also think +romanemul1 request for a video regarding pointers is well justified. After all, we've had search algorithms. Not search as in the broader principles of searching, but Dijkstra's algorithm - a very specific algorithm.
      Edit 2: I also don't think it's justified to call pointers a concept. We have abstract data types which are by definition concepts. Not pointers?

    • @djdedan
      @djdedan 8 років тому +3

      pointers are memory addresses :-) best way to understand pointers is to do some asm :-)

    • @JuddMan03
      @JuddMan03 8 років тому

      BlinkY what if anotherVar is a pointer to a pointer?

  • @davidsweeney111
    @davidsweeney111 8 років тому +1

    This is so cool, Im going to the library to get a book on this! Thanks!

    • @kensmith5694
      @kensmith5694 8 років тому

      Yes, it is extremely cool. To keep it simple he left out a bit about returning to the program. The software may decide not to do that right now. It may have all the context information for a different chunk of code and swap to it. This lets you effectively have two programs (or more) on the machine. This is how advanced OSes go back and forth between many tasks to give the effect of them all running.

  • @aliedperez
    @aliedperez 8 років тому +5

    actually, multi-core processors are fairly recent. I remember installing interrupt handlers in ye olde 8086. Those were simpler times indeed...

    • @djdedan
      @djdedan 8 років тому +2

      nothing simple about 8086 but i agree with the sentiment :-)

    • @aliedperez
      @aliedperez 8 років тому +3

      I said "simpler", not "simple". And I was referring more to the whole system than the processor itself, compared with current systems. But I see you agree with the sentiment, and I'm glad to have lived such times.

  • @emreproxtr
    @emreproxtr 10 місяців тому +1

    Thanks Sam Porter Bridges

  • @FrontalBeep
    @FrontalBeep 8 років тому +2

    I find it interesting that an "interrupt" sounds so drastic (and it probably was at the time) but nowadays when processors can execute millions of instructions per second (not even talking about multi core/multi thread stuff) it seems trivial.

    • @advice-13
      @advice-13 8 років тому +1

      1 GHz = 1 billion instructions per second.
      But you still need interrupts, or you computer would wasting a large chunk of that just checking every possible input.

    • @UntouchedWagons
      @UntouchedWagons 8 років тому +1

      1Ghz = 1 billion cycles per second, instructions can take multiple instructions

    • @karlosdaniel6537
      @karlosdaniel6537 3 роки тому

      @@advice-13 You confused clock cycles per second with instructions per second.

  • @Ovenman940
    @Ovenman940 8 років тому +4

    Please can you do something on DMA and RTOSes?

  • @Tfin
    @Tfin 8 років тому +14

    Unringing all the notification bells, because YT is spamming me.

    • @Rififi50
      @Rififi50 8 років тому +16

      What's the point of these anyway? "Subscriptions" seems to show all uploads of my subscriptions either way.

    • @ericsbuds
      @ericsbuds 8 років тому +11

      yeah I spent 20 minutes turning on all the bells just to have to go back and spend another 20 minutes turning them all off. fucking miss the old comment notification too. now I get a giant list of notifications at the top and I have to load the video to respond to anyone.

    • @ELYESSS
      @ELYESSS 8 років тому +2

      I no longer get comment reply notifications anymore

    • @gameking008
      @gameking008 8 років тому

      why would you ring all your notification bells?!

    • @Triantalex
      @Triantalex Місяць тому

      ok?

  • @dreammfyre
    @dreammfyre 8 років тому +3

    Thank god for programmers.

  • @vicr123
    @vicr123 8 років тому +8

    EDIT: Scratch that... Seems to be answered in the extra bits... Maybe I should watch the whole video (including the outro) first... :)
    -What if, during an Interrupt Service Routine, another interrupt appears? Wouldn't you eventually overflow something? :/-

    • @stoltheds7698
      @stoltheds7698 8 років тому +2

      Victor Tran as long as there is enough RAM to remember the state before each interrupt... it shouldn't be a problem. (I gess, I don't know C)

    • @vicr123
      @vicr123 8 років тому

      Hand MArshall So a "incoming network info" interior would be placed higher than a "incoming keyboard event" interrupt? What if you have two network cards and one interrupts the other? They all have the same priority :)

    • @joao1982
      @joao1982 8 років тому +1

      it possible, but not recommended/best practice. the ISR should handle as fast as possible their routine. and it should be as simple as retrieving bytes and placing those in an auxiliar buffer to be handle afterwards or so, avoiding possible deadlocks on the code, etc.

    • @ChunkyChest
      @ChunkyChest 8 років тому

      lol I do the same thing no worries

    • @vicr123
      @vicr123 8 років тому

      3m0_Wr3ck Good to see it's not just me :D

  • @AndrewReeman_RemD
    @AndrewReeman_RemD 8 років тому +1

    Great video! Thanks for making it :D

  • @network_king
    @network_king 8 років тому +3

    Is this the same as an IRQ?

  • @johnno4127
    @johnno4127 8 років тому

    Is this related to something which would happen in the 90's? I remember computers freezing, or appearing to freeze, but when you wiggled the mouse they would come back to life.

    • @kaizen9451
      @kaizen9451 8 років тому

      I think that's more to do with CPU lockout that occurred on OS's such as Windows XP et al (I know XP was available in '01 not in the 90's). I remember my uni lecturer talking about the subject and how XP was notorious for locking the CPU. Since true concurrency was not used or commercially available then also? Unless the OS could handle scheduling effectively, your events, such as mouse clicks, were placed into a queue and not processed immediately - leading to freezing.

  • @LazyMcCrazy
    @LazyMcCrazy 8 років тому

    You made it very easy to understand! Thank you

  • @dermartologie
    @dermartologie 8 років тому +3

    I didn't quite like the explanation. Interrupts are not only used for things that need to be handled fast. A buttonhandler is also a good example for an interrupt service routine, because if you're only waiting for the user to press a button, you can halt the cpu und save power. Also all that "remembering" what the program was doing before is part of the ISR and not build into the CPU except for the program pointer.
    Also Interrupts in an ISR are possible. You need to disable them in the ISR yourself. Well, at least on the platforms I know.

  • @FyberOptic
    @FyberOptic 8 років тому +2

    I miss the days when you could hook interrupts and interact directly with video memory and registers. I don't necessary miss segmented memory, though!

  • @armornick
    @armornick 7 років тому +1

    I don't know how Linux and Mac do it, but Windows actually puts all of the interrupt events into a message queue and sends them to every Window that's listening. Modern operating systems don't give user-mode applications direct access to the interrupts.

  • @Frrk
    @Frrk 8 років тому

    So I programmed on an arduino last year but I never used interrupts for button presses because you couldn't debounce them in code...could I have used interrupts anyway?

  • @TechyBen
    @TechyBen 8 років тому +6

    I've been actively using this little bit of function in my Arduino code. :D
    Now if only I can get it working... ;)

    •  8 років тому

      What are you working on?
      Also, if you would like me to, I may be able to assist in locating the error if you share the code. :)

    • @TechyBen
      @TechyBen 8 років тому

      No the code as much the application. I'm looking at getting the right type of sensor for my needs... then it will be getting the right code for it. I've done proof of concepts, now to tune the two (software/hardware).

    •  8 років тому +1

      Electronics and computer science guy here, so the offer still stands.

    • @farrukhsaif108
      @farrukhsaif108 4 роки тому

      @ nice

  • @felixblanke8076
    @felixblanke8076 8 років тому

    Do you really import Club Mate into the UK? :D
    (Box in the upper left corner, 6:20)

  • @JFrameMan
    @JFrameMan 8 років тому

    how do interrupts actually work on the hardware level? wouldn't the cpu need to poll the button anyway to find out if it should interrupt or not?

  • @cgme7076
    @cgme7076 8 років тому +1

    I have been an aspiring programmer for a couple years now, and have programmed in several languages, and am currently back to C (for the time being - until I can get an Arduino board), and am also trying to decide on a degree for college. I want to know what type of degree would cover things like this, and allow me to program my own boards.

    • @hellterminator
      @hellterminator 8 років тому +5

      Computer engineering/embedded system design is what you want.

    • @cgme7076
      @cgme7076 8 років тому +1

      Thank you

    • @hellterminator
      @hellterminator 8 років тому +4

      CGMe You're welcome. Also, speaking of Arduino, if you're tight on money, don't hesitate to get a $5 chines clone from Aliexpress. They hold up well and since Arduino is an open source project designed to bring cheap an easy educational kits to everyone, there aren't any moral issues either (clones are perfectly fine under Arduino's license, as long as they don't use the official logo, that's trademarked). You should only get the official boards if you have the money and want to support the project.

    • @hellterminator
      @hellterminator 8 років тому +1

      ***** They're really nice for beginners because there are easy to use libraries for pretty much anything and tons of tutorials.
      Also, as an ex-professional embedded system designer I still buy Arduinos because they're a nice all-in-one basic package. The last thing I need when prototyping is messing around with resonators and power circuitry.
      I don't really use anything from the Arduino ecosystem (I do all the coding in Atmel Studio), I just think they make for neat and cheap dev kits.
      They're also pretty nice for making extremely simple one-offs that aren't worth making a dedicated PCB for (because you need like one or two extra components beside the Arduino). A $1.50 Pro Mini clone with a sensor directly soldered on beats leaving breadboards all around the place.

  • @tyr1224
    @tyr1224 4 роки тому +2

    Have you ever written an interrupt routine?

    • @mikejones-vd3fg
      @mikejones-vd3fg Рік тому

      I did once, it went like this "counter++" it was for a delay thing i was trying to implement with chatgtp's help and it had me incrimenting a counter in the routine, didnt work in the end

  • @AbdullahMohammadOzair
    @AbdullahMohammadOzair 8 років тому

    is it then possible that the delay of 500ms may actually end up being longer than that, in case where the handling of the interrupt takes more time?

    • @djdedan
      @djdedan 8 років тому

      usually your interrupt code is small and fast... sometimes you may have time to look up an address and move to a register and that's it... depending on the interrupt, from my exp.

  • @yanfe384
    @yanfe384 8 років тому

    What happens, when I have more than 1 interrupt pin? So, if I interrupted my programm with pin 1 and while still in the inerruption routine, Interruption pin 2 fires. Can I interrupt my interruption this way?

    • @yanfe384
      @yanfe384 8 років тому

      3 seconds later in the video... ah ok XD

  • @arik_dev
    @arik_dev 5 років тому +1

    Does anyone know if interrupts can get dropped? What happens if the os gets flooded with them in a very short space of time?

    •  Рік тому

      The interrupt controller tracks all interrupt lines (IRQs). For every interrupt line, a bit is set if an interrupt has been triggered on that line but not yet handled. Thus, the ISR is guaranteed to be executed sooner or later after the triggering event, but not necessarily as many times as the interrupt line was triggered.

  • @7markhunter
    @7markhunter 8 років тому +1

    I prefer the idea of increasing the buffer size

    • @xybersurfer
      @xybersurfer 8 років тому

      yes, i also prefer the idea of accommodating the hardware to fit the conceptual ideas

  • @solomontan1524
    @solomontan1524 7 років тому

    Does the "hardware buffer" the guy mentioned at 3:39 refer to the FIFO buffer?

  • @Steven-j1Steven__58c2
    @Steven-j1Steven__58c2 6 місяців тому

    Be part of an exclusive interview with the CEO of Binance to gain insights into future developments

  • @Bentehest
    @Bentehest 8 років тому

    Sorry to say this, but I think you should take care of the broken piece of wire in the middle part of row 15 of your board. May I suggest a pair of tweezers? :) 2:46

  • @GuildOfCalamity
    @GuildOfCalamity 8 років тому +1

    surprised there was no mention of pushing and popping the stack

    • @izimsi
      @izimsi 8 років тому +1

      GuildOfCalamity That video has so simple explanation, that it actually gives pretty much no information at all.

    • @jamesadfowkes
      @jamesadfowkes 8 років тому +2

      Thought about it, decided I should keep it as simple as I could.

    • @GuildOfCalamity
      @GuildOfCalamity 8 років тому +2

      Right, you could've blown minds by getting into instruction pointers.

  • @felador5959
    @felador5959 8 років тому +1

    I'm no expert but isn't there a way of having multiple threads and isn't that more suitable and recognisable by other programmers?

    • @iAmTheSquidThing
      @iAmTheSquidThing 8 років тому +2

      Yes, but not on a tiny microprocessor like the one in an Arduino.

    • @iAmTheSquidThing
      @iAmTheSquidThing 8 років тому +1

      +Kenpachi Zaraki As I understand it, though. It wouldn't really be running multiple threads. It would just be simulating it by _protothreading_, switching back and forth between two sets of instructions.

    • @AndersJackson
      @AndersJackson 8 років тому +1

      ***** well, Arduino is not one of those systems. And it add complexity on a low performance unit.
      It is a reason that Multics didn't become a commercial success...

    • @AndersJackson
      @AndersJackson 8 років тому

      ***** yes, so what?
      This video was about that hardware and libraries...

    • @xybersurfer
      @xybersurfer 8 років тому

      if there are multiple threads then there is thread switching, and if your thread was not the one running then it could have missed the signal. it's not so much about doing multiple things at the same time. it's more about the guarantee of not missing a signal.
      also by introducing multiple threads it becomes very hard to give guarantees about the time it takes the system to respond (a.k.a. real time). which is a lot of times important for embedded devices

  • @ManWithBeard1990
    @ManWithBeard1990 8 років тому +3

    Just a quick FYI that has nothing to do with computers, but the whole point of revolving doors is that the inside and outside are never connected. You need that in some buildings because the air inside is at a different temperature, and due to convection a pressure difference between inside and outside will exist at the bottom and the top of the building.

  • @SKyrim190
    @SKyrim190 Рік тому

    Who else was looking at the green LED and going "what is he talking about, this is not flickering at all?" for a while?

  • @Seegalgalguntijak
    @Seegalgalguntijak 8 років тому

    Is that a Cinnamon desktop on the Lenovo laptop? Or is it Gnome2/MATE?

  • @The1wsx10
    @The1wsx10 7 років тому

    if you want to time something, how can you subtract the time taken by interrupts?

  • @orlinzer123
    @orlinzer123 8 років тому +1

    Please do video on backpropagation algorithm in neural networks

    • @iAmTheSquidThing
      @iAmTheSquidThing 8 років тому

      I think they did. With Dr Mike Pound. Also Welch Labs has a great series on that.

    • @orlinzer123
      @orlinzer123 8 років тому

      they not

    • @kaizen9451
      @kaizen9451 8 років тому

      +or linzer Victor Lavrenko here on UA-cam does an excellent series on machine learning. I only wish I had the videos when in uni.

  • @smegskull
    @smegskull 8 років тому +1

    are controller inputs in video games interrupts then?

    • @MarkKing1979
      @MarkKing1979 8 років тому +1

      smegskull yes

    • @smegskull
      @smegskull 8 років тому

      Mark King ok. cool. can VBA do interrupts?

    • @kalleguld
      @kalleguld 8 років тому

      No, interrupts are handled by the operating system. But if you set up your VBA program correctly, the OS will trigger an event when the user presses a controller button.

  • @mbright69
    @mbright69 8 років тому +1

    Which model laptop is on the desk there?

  • @TheWeepingCorpse
    @TheWeepingCorpse 8 років тому

    i wrote my first software sprite ISR in z80 assembler on the zx spectrum in the 80s. the interrupt was in sync with the TVs vertical blank which was at 50hz. good times lol.

  • @OmarAbdElkareem
    @OmarAbdElkareem 8 років тому

    please, can you make an english subtitle for your videos ? 😢

  • @jamesyu1093
    @jamesyu1093 8 років тому

    *British* spelling: _programme_
    _American_ spelling: program

  • @dims2805
    @dims2805 4 роки тому

    how to stop the system interrup manually?in a manner?
    pliz

  • @LeRouxBel
    @LeRouxBel 8 років тому

    Wait a minute, did you use Processing on that video ? At around 1 min, that kinda looked like the Processing editor.

  • @rabreu08
    @rabreu08 8 років тому

    Why not go full event based programming?

  • @supersu6138
    @supersu6138 3 роки тому

    Are interrupts bond with OS?

  • @kaizen9451
    @kaizen9451 8 років тому

    I'm assuming the interrupt code used in this example was a 3rd party library?

    • @jamesadfowkes
      @jamesadfowkes 8 років тому +1

      Yeah, Arduino takes care of all of that for you.

    • @kaizen9451
      @kaizen9451 8 років тому

      OK interesting, thank you. I had a uni project which required similar characteristics of the Arduino as was demonstrated in this video. Though as far as I was aware at the time, Arduino had no native programmable interrupts. I relied on polling for demonstration purposes.

  • @olasoderlind5685
    @olasoderlind5685 8 років тому

    but what if i want more then one interrupt arduino and other chips have only 1 interruption-eble pin

  • @aoldatabase
    @aoldatabase 7 днів тому

    Thanks!

  • @voiceoftreason1760
    @voiceoftreason1760 6 років тому

    I would have made screenshots of the arduino program for this video.

  • @hieil650
    @hieil650 8 років тому

    that's uncomfortable to watch, and I'm understanding

  • @ZipplyZane
    @ZipplyZane 8 років тому +1

    Suggestion: instead of putting the cards on top of the videos, why not put the videos down below the cards? You've got plenty of room!

  • @ivuldivul
    @ivuldivul 8 років тому

    Upvote if you tried to mask non-maskable interrupt.

  • @DrZygote214
    @DrZygote214 2 роки тому +2

    Okay, I have a question. What happens if a different interrupt comes in before the first ISR is finished? How do you guarantee that the system won't be locked out by a swamp of constant interrupts?

    •  Рік тому +2

      There are a few ways, depending on the platform. Typically, interrupts are disabled until the ISR re-enables them (which could happen automatically when the CPU flags are restored when the ISR returns, this is probably the most "atomic" way to do it). Often the ISR also has to tell whatever hardware caused the interrupt that it is done, and that it can now send another interrupt, as the hardware often won't send another interrupt before the previous interrupt has been dealt with. Interrupts may also have priorities. On x86, even if interrupts are enabled on the cpu, the programmable interrupt controller (PIC) will only interrupt any executing ISR (before the ISR has told the PIC that it's done) if the new interrupt is of higher priority.

    • @ivandagiant
      @ivandagiant Рік тому

      In my class we had levels of interrupts, higher levels could cause a nester interrupt but lower levels would be ignored

  • @Sandra__651d
    @Sandra__651d 6 місяців тому

    Swift and effective reimbursement

  • @AmolGautam
    @AmolGautam 10 місяців тому +1

    nice

  • @ADRIANNORMANNINA
    @ADRIANNORMANNINA 8 років тому

    Nice Video!

  • @minutebrainperson8324
    @minutebrainperson8324 8 років тому +1

    I like the, title.

  • @necropola
    @necropola 8 років тому +1

    Developers should never get away with polling (in userspace) and sleep() should be banned. Don't get me wrong, I like this video, because the micro-controller perspective -- where you don't have the Operating System handling the actual interrupt -- is a good starting point into the area/problems of asynchronous (inter-process) communication.
    It would be nice to see a followup showing how kernel and user space work together when handling events, what a mutex/semaphore is and why select()/poll()/epoll() is such a cool system call.

    • @kensmith5694
      @kensmith5694 8 років тому +1

      I would make an exception for a sleep() for over a minute.

    • @advice-13
      @advice-13 8 років тому +2

      I think that would be a very bad idea, as it's a long arbitrary length. And would cause a lot of bugs for developers.
      I know Android will throw an ANR (app not responding) if your UI thread takes over 5 seconds to render the next frame. But other threads can sit in the background as long as you want.
      You may want to sleep a thread for awhile, say in a game where you're randomly spawning items on a timer. There are better ways to do that, but it works.

    • @necropola
      @necropola 8 років тому

      ***** When your program needs to do more than just display/update a clock, i. e. you need to catch some sort of (I/O-)event, using sleep() in a polling loop is wrong.
      I'm beginning to wonder, whether threads have been invented for X Window developers who didn't know select(). ...

    • @hellterminator
      @hellterminator 8 років тому +1

      ***** I'm beginning to wonder if select was invented for dummies who didn't know how to simply plug their code into the main system loop. /s
      1. Threads are much simpler than select, what's wrong with that?
      2. Most environments won't let you group all kinds of events into a single select (i.e. you can use select to wait on multiple network sockets, but not on a socket or a key press) and even if they did, the resulting code would be a mess.
      3. Select doesn't facilitate preemption. If your program performs some non-trivial computation (like video rendering), it will be completely frozen until that computation finishes. What's that? You want to prepare the next rendering job while the current one is being processed? Tough luck, we removed threads because ***** didn't like them, so you're gonna have to wait.

    • @advice-13
      @advice-13 8 років тому

      +hellterminator, Do you keep deleting your comments after people reply to them?

  • @alecclews
    @alecclews 8 років тому

    Ow! I never knew Arduino processing supported creating ISRs. I'll have me some of that...

  • @DanDart
    @DanDart 8 років тому

    Irony as loading bar at 0:02

  • @slendi9623
    @slendi9623 6 років тому

    the only problem i have with my os, is idk how to handle keyboard

  • @NakushitaNamida
    @NakushitaNamida 8 років тому

    -Please make some efforts for pronunciation , a lot of computerphile viewers are not from an english speaking country and i had a lot of trouble understanding you. Anyway thanks for the efforts-
    [EDIT] finished the video , it just seems James Fowkes is just not at ease with a camera pointed toward him. With some focus i managed to understand everything .

  • @Kal3it
    @Kal3it 8 років тому

    Please add spanish subtitles :(

  • @touisbetterthanpi
    @touisbetterthanpi 8 років тому

    Isn't Linux built on interrupts?

    • @jpratt8676
      @jpratt8676 8 років тому

      David Sullivan Most OSs have a concept of interrupts because they manage complex hardware. It is not OS specific

  • @rkpetry
    @rkpetry 8 років тому

    "Interrupts" are exactly what they sound like: crude mismanagement of task scheduling in an obviously multitask environment, by 'bullying' the CPU into excessive make-work-action-administrative processing resulting in thrashing and clock-heating and ultimately exposure of vulnerabilities culminating in security breaches....

    • @balala7567
      @balala7567 Рік тому

      Would you rather:
      -Check the time every second to see if it's time for something
      *or*
      -Set an alarm for that thing

  • @divasimao5290
    @divasimao5290 8 років тому

    It seems that some of you like gnome classic :)

  • @notsoverflow
    @notsoverflow 8 років тому

    algo helper comment

  • @Brutaltronics
    @Brutaltronics 8 років тому

    oh damn arduinos everywhere!

  • @RandomNullpointer
    @RandomNullpointer 7 років тому

    The Kripke accent :)

  • @linuxisstillthebest6863
    @linuxisstillthebest6863 8 років тому

    I haz the same raspberry Pi and the same pinboard :)

  • @tankmohit
    @tankmohit 8 років тому

    +1 for gnome

  • @garbagegamer6198
    @garbagegamer6198 8 років тому +3

    First dislike

  • @goldchalice
    @goldchalice 8 років тому

    I've never heard of the term "Interrupt". What the programmer in the video seems to describing is Event handling? I take it "Interrupts" are a very low level concept.

    • @peterlinddk
      @peterlinddk 8 років тому +2

      Interrupts are what happens in the hardware. Event handling is how the software (higher level languages, and APIs mostly) handles those interrupts. The main difference is that the event handling is not necessarily driven by interrupts, but could be done by polling - your program wouldn't know the difference.

  • @nysonrizqi1428
    @nysonrizqi1428 8 років тому +4

    first one!!

    • @maw9406
      @maw9406 8 років тому

      Nyson Rizqi cra

  • @jaymalby
    @jaymalby 8 років тому +2

    Second!

  • @yepperdeedooda
    @yepperdeedooda 8 років тому +6

    I'm pretty sure you need to be really smart to even kind of understand this. I love trying to fix things on my own, but this is way too smart for me.

    • @LazyPanda21
      @LazyPanda21 8 років тому +16

      3rd year Electronics engineer here
      It's actually one of the easiest concepts to understand and apply while studying microcontroller architecture, and we had to do it using Assembly

    • @assalane
      @assalane 8 років тому +22

      you need to learn programming and how computers work. Saying "you need to be smart" do to anything is just an excuse

    • @yepperdeedooda
      @yepperdeedooda 8 років тому

      Azthecx yeah, too confusing. I just learned what an integer was. But I still want to be able to fix my computer. My battery swelled up and it's dead now and I need to have it plugged in for it to work.

    • @yepperdeedooda
      @yepperdeedooda 8 років тому +7

      assalane I am taking a computer science class though.

    • @valentinidk6101
      @valentinidk6101 8 років тому +3

      Ксения Ковалевская​​ ... an integer... are you serious? i honestly think you shut quit this already

  • @101m4n
    @101m4n 8 років тому

    This guy looks a bit like ricky gervais...
    Hate that guy.