Thursday, April 14, 2011

4/14 Point of view / Threads

Post a response to the Question of the Day in 5 minutes or less, using complete sentences, use proper grammar, spelling and punctuation.

Come join me on the new My Campus. - Mr. Viereck 

ICT Essentials 1
Question of the Day: From your point of view why do you think that some people check their Facebook or Twitter accounts constantly?  Is this a form of addiction?

Daily Objectives: 
Identify the criteria for evaluating websites and online resources. Evaluate and select information sources and digital tools based on the appropriateness for specific tasks.Use the criteria to evaluate preliminary websitesLocate sources (intellectually and physically). Find information within sources.Locate, evaluate, synthesize, and ethically use information from a variety of sources and media.

Word of the Day: Point of view -
1. A particular attitude or way of considering a matter: "change his point of view".
2. (in fictional writing) The narrator's position in relation to the story being told.

Question of the Day:
What is a thread?
What happens when you use multiple threads?
What label begins a thread in Scratch?
Why do you think you should use separate threads?

Daily Objectives: 

Describe and use statements to create a computer program.Describe and use Boolean expressions to create a computer program.Describe and use Conditions to create a computer program.Describe and use Loops  to create a computer program.Describe and use Variables to create a computer program.

Word of the Day: Threads - In programming, a thread is like a mini-program within a program that can execute at the same time as other threads. A program with multiple threads, then, can do multiple things at once. In Scratch, any block whose label begins with "when" essentially demarks the start of a thread; think of what Scratch calls a "script" as a thread. (Technically, scripts run in threads, but never mind that.)
One such block is:

As the above block's label suggests, this thread begins to execute when the user click's Scratch's green flag. A program with two such blocks thus has two "threads of execution," both of which start simultaneously when the user clicks Scratch's green flag.
It's often helpful to use separate threads for conceptually distinct tasks. For instance, you might want to keep track of whether the user ever presses some key during a program's execution in order to, say, toggle sound on and off:

Notice how, in the above, the left-hand thread handles meowing, if appropriate, whereas the right-hand thread constantly checks and remembers whether the user has muted or unmuted sound by pressing 'm'.

No comments: