Important: The information in this document is obsolete and should not be used for new development.
Chapter 5 - Programming With Open Transport
This chapter examines methods of structuring Open Transport programs and discusses the relative merits of these methods in the context of the Mac OS cooperative multitasking environment. The chapter also takes a closer look at Mac OS interrupt levels and explains how Open Transport processing is affected by interactions between code executing at these levels. You should read this chapter if you are writing a server application, encountering synchronization problems, or want to improve performance. The chapter "Programming With Open Transport Reference" includes detailed information about the functions introduced in this chapter.To use this chapter, you need to be familiar with system tasks, deferred tasks, and interrupts in general. For additional information about system tasks, read the information about the
SystemTask
function in the chapter "Event Manager" in Inside Macintosh: Macintosh Toolbox Essentials, and for additional information about interrupts and deferred tasks, read the chapters "Introduction to Processes and Tasks" and "Deferred Task Manager" in Inside Macintosh: Processes.
Chapter Contents
- Open Transport Programming Models
- Using Synchronous Processing With Threads
- Polling for Events
- Using Asynchronous Processing With a Notifier
- Interrupt-Safe Functions
- Memory Management From Notifiers
- Interrupt Levels and Open Transport Processing
- Hardware Interrupt Level
- Deferred Task Level
- System Task Level
- Using Timer Tasks
- Using System and Deferred Tasks
- Calling Open Transport Functions
- Scheduling Tasks
- Deallocating Resources
- Handling Synchronization Problems
- Handling Multiple Simultaneous Connections
- Problems With Accepting Multiple Simultaneous Connections
- Using "tilisten" to Accept Multiple Simultaneous Connections
- Improving Performance
- Streamlining Endpoint Creation
- Handling Dead Clients
- Shutting Down Servers