Design  | SFC  |  NOS  |  Code |  Diary  | WWW |  Essay |  Cisco | [Home]

 

 

[Bill's Home Page]
[ Old page]

Essays


One of the best-known software errors occurred on 22 July 1962 when the Mariner I rocket had to be blown-up, after it followed an erratic path after it took off. It was caused by a single incorrect character in a FORTRAN statement for the motion equations.

In 1963, ANSI defined the 7-bit ASCII standard code for characters. At the same time IBM had developed the 8-bit EBCDIC code which allowed for up to 256 characters, rather than 128 characters for ASCII. It is thought that the 7-bit code was used for the standard as it was reckoned that eight holes in punched paper tape would weaken the tape. Thus the world has had to use the 7-bit ASCII standard, which is still popular in the days of global communications.
Key characters to remember are:
'A' 41h 0100 0001
'a' 61h 0110 0001
'0' 30h 0011 0000

LF 0Ah 0000 1010
CR 0Dh 0000 1101

Mastering Comput-ing, W.Buchanan, Palgrave

Isn't that interesting?

 


 


 

 

 

 

 

 

 

Threads

16 June 2001

he logical extension to multitasking programs is to split a program into a number of parts (threads) and run each of these on the multitasking system (multi-threading). Multi-threading can be likened to splitting sequential tasks, into a number of interrelated tasks. For example, let's say that you have to cook a meal with the following recipe:

1. Put potatoes on to boil.
2. Put pie in the microwave, on HIGH for 10 minutes.
3. Wait for potatoes to become soft.
4. Take potatoes out of pan, and place on the plates.
5. Wait for pie to complete.
6. Take pie out of microwave and place on the plates.
7. Put carrots in pan, and boil.
8. Wait for carrots to become soft.
9. Take carrots out of pan, and place on the plates.

The problem with this recipe is that someone could be waiting at step 4 to complete, while they could be checking the pie to see if it has complete. An improved method would use independent subtask, which were interrelated. In this case the pie and the potatoes are not interrelated, but the potatoes and the carrots are (assuming that we only have one pan). Figure 3.9 shows a possible schedule using subtasks (or threads of the main task), where we now have six main threads. Each of the threads can run independently, but some cannot run to until they have received something from another thread. For example it is not possible for the 'Put potatoes on plate' thread to start until it has received the potatoes from the 'Boil potatoes' thread.

A threads-based approach allows us to create specialized task, which have a small defini-tive goal. It is much easier to test a small program which has a definitive task, rather than to test a large and complex piece of software. It is also easier to upgrade a thread, without af-fecting the overall operation of the complete program.

Figure 3.9 (© billatnapier)

Comments on this essay

If you've got any comments on this essay (no matter if you agree or disagree with it), please send them to me using the form below.

Details

Name (Surname, First Name):

[Not required]

E-mail:



Your comment

 

Note your comments may be published to a comments pages, but none of your details will be added to the comment, just the date that it was sent. Thank you.