Answers.Body: <p>A good analogy would be (sorry, smartphone ringing, i've got to leave)</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2020-01-13T02:28:37.653Z
Answers.Text: I have come up with a truly remarkable proof, which this comment is too small to contain.
Answers.UserDisplayName: Scott Rowe
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-29T13:20:08.660Z
Answers.LastActivityDate: 2019-10-29T13:20:08.660Z
Answers.UserDisplayName: Michel Billaud
Answers.Body: <p>I would use the example of when one thought runs into another in your head, and two words are interleaved as a result, for example if you're trying to say "awesome" and also "exciting," you'll say "awe -- citing" or "ex -- some." This is because the process of you saying one word has been interrupted by some thought and jumped to saying another word. I think that this is an experience that many people have had, and really accurately gives the <em>feeling</em> of an interrupt, i.e. an immediate involuntary jump to something else.</p>
  
  <p>However, if you're looking for an analogy which will better lead to some kind of project or programming insight, this may not be the best analogy.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-30T05:14:50.380Z
Answers.LastActivityDate: 2019-10-30T05:14:50.380Z
Answers.UserDisplayName: thesecretmaster
Answers.Body: <h1>Classroom activity.</h1>
  
  <hr>
  
  <p>A. <strong>The prep.</strong></p>
  
  <ol>
  <li>Some project requiring a few minutes of the students' time. Writing down definitions from the board, or researching something online. Anything which fits within the normal operations of the class, and requires each student to do their own work and excludes other activities.
  
  <ul>
  <li>A useful possibility here would be to create some defined directory structure on their local/lab computer, including starter source files, which will be needed for later code projects. (If the students have workstations and the course will involve code work in the following weeks.)</li>
  </ul></li>
  <li>A small project, or a few such, which one student can be asked to do during class. Hand back graded papers, distribute lesson materials, move a table, etc. </li>
  <li>A tennis ball, ping-pong ball, or Nerf ball. Something light, and safe to use in the classroom. If available, a ball large enough to require both hands to catch would be best.</li>
  </ol>
  
  <hr>
  
  <p>B. <strong>The activity</strong></p>
  
  <ol>
  <li>At any point during the class period, at the beginning is not required, assign the main task above to the students.</li>
  <li>At the point when the students should be approximately one-third done with the task, ask one to perform the simple task. If there are multiple simple tasks planned, they can be started in a staggered manner, or they can be performed one at a time. In the case of more than one simple task, allow all but the final one to be completed, and the involved students to return to the originally assigned task.</li>
  <li>While the final, or only, task is being performed, surprise the student performing it by telling them to "think fast" or "catch this", and toss the ball to them with barely enough time to react.</li>
  <li>Allow the final simple task to be completed after the ball has been tossed, and allow all the students to complete the main task.</li>
  <li>Proceed with the lecture, or discussion, on interrupts.</li>
  </ol>
  
  <hr>
  
  <p>C. <strong>Taking points</strong></p>
  
  <ol>
  <li><p>While the OS is loaded, the computer is always <em>doing</em> something. Typically the on-screen clock is updated in most windowed environments. Who know what "housekeeping" activities are happening under the hood. If nothing else, the system is looking for further instructions.</p>
  
  <ul>
  <li>Prior to the assignment being given, the students were <em>doing</em> something. Thinking about the last class, planning what to do after class, looking at the clock, or, at the very least, waiting for what you would say next.</li>
  <li>The primary assignment was an example of <em>event-driven</em> operations, where the system is idle until something is requested. The user launches a program, for example. The request is handled, and then the system goes idle again, awaiting another event to respond to.</li>
  </ul></li>
  <li><p>While following instructions, the system is also monitoring other sources of instructions; interrupts. A normal interrupt causes the system to pause one task, at some convenient point, and process the new request. Completion of the new request is followed by resuming the original, or interrupted, task.</p>
  
  <ul>
  <li>When asked to perform the simple task, the affected student did not stop immediately and begin the new task. They did not stop writing mid-stroke on a letter, or probably even mid-word, if writing. They did, however, pause the main activity to handle the simple assignment, and returned to complete the main activity once they had accomplished the simple request.</li>
  </ul></li>
  <li>Different tasks and interrupts have different priorities, and when, or even if, the system responds to them depends on relative priorities of the task to be interrupted and the interrupt itself.
  
  <ul>
  <li>Each student involved did their own <em>scheduling</em> around the simple tasks. Completing a letter, work, line, thought, or sentence was their choice. None of them (hopefully) assigned a low enough priority to the simple task as to complete the main assignment before starting the simple task.</li>
  </ul></li>
  <li>In some systems there are interrupts with an assigned priority as to be unavoidable. Factory floor robotics <strong>must</strong> respond to a safety sensor, for example. The computer might ignore most pressed keys if something is running. <kbd>CTRL</kbd>+<kbd>C</kbd> is often an exception to that rule. <kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>DEL</kbd> is almost always an exception, in Microsoft Windows anyway. Such interrupts are often called <em>priority</em> interrupts.
  
  <ul>
  <li>Catching the ball was not planned by the receiving student, yet the response was instantaneous, even if the ball was dropped.</li>
  </ul></li>
  </ol>
  
  <hr>
  
  <p>D. <strong>Bonuses</strong></p>
  
  <ol>
  <li>If there was more than one simple task applied, and two, or more, were being done at the same time, multi-core threading can be discussed.</li>
  <li>If, when trying to catch the ball, the student dropped the papers, or somehow <em>messed up</em> the task, you can discuss security exploits which operate on <em>exceptions</em>; divide-by-zero errors, segmentation faults, etc.</li>
  </ol>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-30T03:01:31.073Z
Answers.Text: You did not disappoint. That is a beautiful answer!
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-30T05:16:15.550Z
Answers.Text: I really like this activity as an explanation of interrupts, but I think it may detract from the learning of the students being interrupted or being assigned those simple tasks.
Answers.UserDisplayName: thesecretmaster
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-30T05:30:59.443Z
Answers.Text: @thesecretmaster The learning of the students shouldn't be impacted as the main assignment is planned, in the prep section, specifically to be interrupted. Aside from seeming to be legitimate so that the students "do" it, the assigned work need have no purpose other than giving them something to "do" until the "interrupts" occur.
Answers.UserDisplayName: Gypsy Spellweaver
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-11-01T09:47:37.690Z
Answers.Text: Yes, a good exercise.
Answers.UserDisplayName: Mallam Awal
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-30T02:29:04.083Z
Answers.LastActivityDate: 2019-10-30T05:36:07.317Z
Answers.LastEditDate: 2019-10-30T05:36:07.317Z
Answers.UserDisplayName: Gypsy Spellweaver
Answers.Body: <p>Fire alarm goes off during exam. </p>
  
  <p>Nasty uncle Ben shows up in the middle of supper. </p>
  
  <p>Tire blows out while driving.</p>
  
  <p>Student raises hand during lecture. </p>
  
  <p>Baby wakes up in the night, screaming.</p>
  
  <p>Anything in general, that happens without warning and that requires attention or action of some kind. </p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-29T12:28:12.703Z
Answers.Text: Hey, I may be nasty, but I show up *before* supper!  Otherwise, how will I get fed?
Answers.UserDisplayName: Ben I.
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-29T12:30:54.003Z
Answers.Text: Thought you'd like that. But Ben as in Rice, not Ben as in I.  But the analogy doesn't work as well that way, though.
Answers.UserDisplayName: Buffy
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-10-29T11:38:51.147Z
Answers.LastActivityDate: 2019-10-29T11:38:51.147Z
Answers.UserDisplayName: Buffy
Body: <p>What will be a simple analogy to use in teaching non-CS people the concept of interrupt as part of OS topic?</p>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-29T00:47:36.650Z
Comments.Text: Toss a ball to them while they are reading a book.
Comments.UserDisplayName: Gypsy Spellweaver
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-29T03:05:28.307Z
Comments.Text: @GypsySpellweaver Post your answer to receive your updoots, my friend.
Comments.UserDisplayName: Ben I.
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-29T13:08:58.110Z
Comments.Text: @GypsySpellweaver, I was trying to think of a red panda interrupt in my answer but didn't come up with anything. Sorry.
Comments.UserDisplayName: Buffy
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-29T23:02:53.560Z
Comments.Text: An interrupt is like being interrupted. With the caveat that you go back to what you were doing, when you finish being interrupted.
Comments.UserDisplayName: ctrl-alt-delor
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-10-31T18:27:37.500Z
Comments.Text: https://tvtropes.org/pmwiki/pmwiki.php/Main/ExactlywhatItSaysOnTheTin
Comments.UserDisplayName: Daniel R. Collins
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2019-11-01T09:44:43.063Z
Comments.Text: @Daniel R. Collins, yea got it. Exactly What it says on the tin... Inter...rupt!
Comments.UserDisplayName: Mallam Awal
Tags: <teaching-analogy>
Title: Analogy to teach beginners the concept of interrupt
ThreadText: # Analogy to teach beginners the concept of interrupt
  
  (Asked by: username_0 on 2019-10-29)
  
  What will be a simple analogy to use in teaching non-CS people the concept of interrupt as part of OS topic?
  
  **Tags:** teaching-analogy
  
  > **Comments:**
  > **username_1**: Toss a ball to them while they are reading a book.  
  > **username_2**: @username_1 Post your answer to receive your updoots, my friend.  
  > **username_3**: @username_1, I was trying to think of a red panda interrupt in my answer but didn't come up with anything. Sorry.  
  > **username_4**: An interrupt is like being interrupted. With the caveat that you go back to what you were doing, when you finish being interrupted.  
  > **username_5**: https://tvtropes.org/pmwiki/pmwiki.php/Main/ExactlywhatItSaysOnTheTin  
  > **username_0**: @username_5, yea got it. Exactly What it says on the tin... Inter...rupt!  
  
  ---
  
  ## 4 answers
  
  ### Answer by username_1 on 2019-10-30. Score: 3 | Accepted answer
  
  # Classroom activity.
  
  ---
  
  A. **The prep.**
  
  1. Some project requiring a few minutes of the students' time. Writing down definitions from the board, or researching something online. Anything which fits within the normal operations of the class, and requires each student to do their own work and excludes other activities.
     * A useful possibility here would be to create some defined directory structure on their local/lab computer, including starter source files, which will be needed for later code projects. (If the students have workstations and the course will involve code work in the following weeks.)
  2. A small project, or a few such, which one student can be asked to do during class. Hand back graded papers, distribute lesson materials, move a table, etc.
  3. A tennis ball, ping-pong ball, or Nerf ball. Something light, and safe to use in the classroom. If available, a ball large enough to require both hands to catch would be best.
  
  ---
  
  B. **The activity**
  
  1. At any point during the class period, at the beginning is not required, assign the main task above to the students.
  2. At the point when the students should be approximately one-third done with the task, ask one to perform the simple task. If there are multiple simple tasks planned, they can be started in a staggered manner, or they can be performed one at a time. In the case of more than one simple task, allow all but the final one to be completed, and the involved students to return to the originally assigned task.
  3. While the final, or only, task is being performed, surprise the student performing it by telling them to "think fast" or "catch this", and toss the ball to them with barely enough time to react.
  4. Allow the final simple task to be completed after the ball has been tossed, and allow all the students to complete the main task.
  5. Proceed with the lecture, or discussion, on interrupts.
  
  ---
  
  C. **Taking points**
  
  1. While the OS is loaded, the computer is always *doing* something. Typically the on-screen clock is updated in most windowed environments. Who know what "housekeeping" activities are happening under the hood. If nothing else, the system is looking for further instructions.
  
     * Prior to the assignment being given, the students were *doing* something. Thinking about the last class, planning what to do after class, looking at the clock, or, at the very least, waiting for what you would say next.
     * The primary assignment was an example of *event-driven* operations, where the system is idle until something is requested. The user launches a program, for example. The request is handled, and then the system goes idle again, awaiting another event to respond to.
  2. While following instructions, the system is also monitoring other sources of instructions; interrupts. A normal interrupt causes the system to pause one task, at some convenient point, and process the new request. Completion of the new request is followed by resuming the original, or interrupted, task.
  
     * When asked to perform the simple task, the affected student did not stop immediately and begin the new task. They did not stop writing mid-stroke on a letter, or probably even mid-word, if writing. They did, however, pause the main activity to handle the simple assignment, and returned to complete the main activity once they had accomplished the simple request.
  3. Different tasks and interrupts have different priorities, and when, or even if, the system responds to them depends on relative priorities of the task to be interrupted and the interrupt itself.
     * Each student involved did their own *scheduling* around the simple tasks. Completing a letter, work, line, thought, or sentence was their choice. None of them (hopefully) assigned a low enough priority to the simple task as to complete the main assignment before starting the simple task.
  4. In some systems there are interrupts with an assigned priority as to be unavoidable. Factory floor robotics **must** respond to a safety sensor, for example. The computer might ignore most pressed keys if something is running. `CTRL`+`C` is often an exception to that rule. `CTRL`+`ALT`+`DEL` is almost always an exception, in Microsoft Windows anyway. Such interrupts are often called *priority* interrupts.
     * Catching the ball was not planned by the receiving student, yet the response was instantaneous, even if the ball was dropped.
  
  ---
  
  D. **Bonuses**
  
  1. If there was more than one simple task applied, and two, or more, were being done at the same time, multi-core threading can be discussed.
  2. If, when trying to catch the ball, the student dropped the papers, or somehow *messed up* the task, you can discuss security exploits which operate on *exceptions*; divide-by-zero errors, segmentation faults, etc.
  
  > **Comments:**
  > **username_2**: You did not disappoint. That is a beautiful answer!  
  > **username_8**: I really like this activity as an explanation of interrupts, but I think it may detract from the learning of the students being interrupted or being assigned those simple tasks.  
  > **username_1**: @username_8 The learning of the students shouldn't be impacted as the main assignment is planned, in the prep section, specifically to be interrupted. Aside from seeming to be legitimate so that the students "do" it, the assigned work need have no purpose other than giving them something to "do" until the "interrupts" occur.  
  > **username_0**: Yes, a good exercise.  
  
  ---
  
  ### Answer by username_3 on 2019-10-29. Score: 3
  
  Fire alarm goes off during exam.
  
  Nasty uncle Ben shows up in the middle of supper.
  
  Tire blows out while driving.
  
  Student raises hand during lecture.
  
  Baby wakes up in the night, screaming.
  
  Anything in general, that happens without warning and that requires attention or action of some kind.
  
  > **Comments:**
  > **username_2**: Hey, I may be nasty, but I show up *before* supper!  Otherwise, how will I get fed?  
  > **username_3**: Thought you'd like that. But Ben as in Rice, not Ben as in I.  But the analogy doesn't work as well that way, though.  
  
  ---
  
  ### Answer by username_6 on 2019-10-29. Score: 1
  
  A good analogy would be (sorry, smartphone ringing, i've got to leave)
  
  > **Comments:**
  > **username_7**: I have come up with a truly remarkable proof, which this comment is too small to contain.  
  
  ---
  
  ### Answer by username_8 on 2019-10-30. Score: 0
  
  I would use the example of when one thought runs into another in your head, and two words are interleaved as a result, for example if you're trying to say "awesome" and also "exciting," you'll say "awe -- citing" or "ex -- some." This is because the process of you saying one word has been interrupted by some thought and jumped to saying another word. I think that this is an experience that many people have had, and really accurately gives the *feeling* of an interrupt, i.e. an immediate involuntary jump to something else.
  
  However, if you're looking for an analogy which will better lead to some kind of project or programming insight, this may not be the best analogy.
  
  
  ---
  
  