Implement the snapshot routine using only signals

Assignment Help Basic Computer Science
Reference no: EM132493987

You have written a piece of code which runs for a very long time.

Let's say on the fastest single processor you can find, the code runs for days if not weeks. There's isn't, for the sake of this question, any opportunity to multi-thread the applications.

In order to preserve as much progress as you application can, you would like to introduce a snapshot routine. All this routine does is creeate all of the state data that your application would require should it need to restart at this particular step. As an example, say you have a loop in your code that needs to be executed a thousand times. Each time through the loop takes several hours. At the top of every loop, you want your code to call snapshot(). This will allow you to re-load the program state in case your program crashes (or there's a power failure etc).

Since you don't want to lose hours of processing, the snapshot() routine can be considered a critical section of code. To ensure that nothing interrupts your snapshot code, you want to disable most of the signals your code might receive from the keyboard (just in case your cat walk across the keyboard when you aren't looking). Once you are done processing the snapshot, it would be nice to re-enable keyboard signals just in case you need to temporarily halt your code (Microsoft is going to reboot your machine whether you like it or not).

Without worrying about the details of saving all of your variables, in 10 lines of code or less, how would you implement the snapshot routine using only signals?

Reference no: EM132493987

Questions Cloud

Create the operating activities section of the statement : Prepare the operating activities section of the statement of cash flows using the Indirect Method. The income statement for Strait Horn Inc
Presents a good cost-benefit trade-off : How can a customer protect against that single point of failure? Provide an analysis on whether this presents a good cost-benefit trade-off?
Find the effect of transaction on the accounting equation is : A business purchased a motor vehicle for $40,000, paying $15,000 in cash and borrowing $25,000. The effect of this transaction on the accounting equation is
Find the amount that should be include in guiglano statement : The amount, if any, that should be capitalized and included on Guiglano's statement of financial position prepared as at April 30, 2020.
Implement the snapshot routine using only signals : Without worrying about the details of saving all of your variables, in 10 lines of code or less, how would you implement the snapshot routine using only signals
Sliced tomato or cucumber should be included : How might they know whether sliced tomato or cucumber should be included in the side orders menu?
Do feel is really expense or just additional stock offerings : Do you feel it is really expense, or just additional stock offerings, by the corporation? For many years, accountants argued whether stock options
Show that in any group of people : Show that in any group of people, two of them have the same number of friends in the group.
Calculate the payments will have to make each month : Assuming you have five (5) full years to reach your goal, calculate the payments you will have to make each month to save the target amount of $50,000

Reviews

Write a Review

Basic Computer Science Questions & Answers

  Identifies the cost of computer

identifies the cost of computer components to configure a computer system (including all peripheral devices where needed) for use in one of the following four situations:

  Input devices

Compare how the gestures data is generated and represented for interpretation in each of the following input devices. In your comparison, consider the data formats (radio waves, electrical signal, sound, etc.), device drivers, operating systems suppo..

  Cores on computer systems

Assignment : Cores on Computer Systems:  Differentiate between multiprocessor systems and many-core systems in terms of power efficiency, cost benefit analysis, instructions processing efficiency, and packaging form factors.

  Prepare an annual budget in an excel spreadsheet

Prepare working solutions in Excel that will manage the annual budget

  Write a research paper in relation to a software design

Research paper in relation to a Software Design related topic

  Describe the forest, domain, ou, and trust configuration

Describe the forest, domain, OU, and trust configuration for Bluesky. Include a chart or diagram of the current configuration. Currently Bluesky has a single domain and default OU structure.

  Construct a truth table for the boolean expression

Construct a truth table for the Boolean expressions ABC + A'B'C' ABC + AB'C' + A'B'C' A(BC' + B'C)

  Evaluate the cost of materials

Evaluate the cost of materials

  The marie simulator

Depending on how comfortable you are with using the MARIE simulator after reading

  What is the main advantage of using master pages

What is the main advantage of using master pages. Explain the purpose and advantage of using styles.

  Describe the three fundamental models of distributed systems

Explain the two approaches to packet delivery by the network layer in Distributed Systems. Describe the three fundamental models of Distributed Systems

  Distinguish between caching and buffering

Distinguish between caching and buffering The failure model defines the ways in which failure may occur in order to provide an understanding of the effects of failure. Give one type of failure with a brief description of the failure

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd