Special

Introducing the “Welcome to Xojo” Bundle!

New to Xojo and looking for guidance? We've put together a terrific bundle to welcome you! Xojo Bundle

This bundle includes six back issues of the magazine -- all of year 14 in printed book and digital formats -- plus a one-year subscription so you'll be learning all about Xojo for the next year. It's the perfect way to get started programming with Xojo. And you save as much as $35 over the non-bundle price!

This offer is only available for a limited time as supplies are limited, so hurry today and order this special bundle before the offer goes away!

Article Preview


Buy Now

PDF:

Feature

The Way of the Thread

Get started with threaded tasks

Issue: 9.5 (July/August 2011)
Author: JC Cruz
Article Description: No description available.
Article Length (in bytes): 25,212
Starting Page Number: 46
RBD Number: 9508
Resource File(s):

Download Icon 9508.zip Updated: Tuesday, July 5, 2011 at 11:17 AM

Related Web Link(s):

http://docs.realsoftware.com/index.php/Thread
http://docs.realsoftware.com/index.php/Semaphore
http://docs.realsoftware.com/index.php/CriticalSection
http://docs.realsoftware.com/index.php/Mutex
http://en.wikipedia.org/wiki/Mutual_exclusion
http://en.wikipedia.org/wiki/Thread_(computer_science)

Known Limitations: None

Excerpt of article text...

Threads serve an important role in many modern software products. So today, we look at the nature of threads and their benefits. We will study the Thread class, its properties and methods. We will glance at the mutex concept and learn how it interacts with a thread. Finally, we will study the basic thread cycle, plus some useful ways to manage a thread.

From Process to Process

When an application launches, the first thing it does is to create a main session (Figure 1). The main session remains active until the application gets a quit signal from the user or it runs into an unhandled exception. Both will cause the main session to terminate. But only a quit signal will make the session save its user data and state.

Now the main session can spawn two or more sub-sessions (Figure 2), each one handling a specific task. Sub-session A may present a window view through which the user interacts. Sub-session B may maintain an input/output stream to an external file. And sub-session C may connect itself to the network cloud.

...End of Excerpt. Please purchase the magazine to read the full article.

Article copyrighted by REALbasic Developer magazine. All rights reserved.


 


|

 


Weblog Commenting and Trackback by HaloScan.com