13.07.2015 Views

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

iAPX 286 Operating System Writers Guide 1983

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 5DATA SHARING, ALIASING, AND SYNCHRONIZATIONEven the simplest multitasking applications present a need for sharing data among tasks. In fact,examples presented in earlier chapters of this book have used data sharing, as in the example proceduresin Chapter 3 that manipulate the free space list. For simplicity, these examples. have avoidedmany of the implications of data sharing. However, sharing data among tasks is a complex activitythat offers many opportunities for one task to cause another to fail. Therefore, for the protection of thesystem as a whole, .the operating system mu~t provide services that promote reliable data sharing.DATA-SHARING TECHNIQUESThe architecture of the <strong>iAPX</strong> <strong>286</strong> allows segments to be shared among tasks through several mecha~nisms. Each mechanism has different advantages and disadvantages, and requires different degrees ofsupport from the operating system.Note that while the primary subject of this chapter is data sharing, these segment-sharing techniquesapply as well to code segments.· .Sharing via the GDTAll tasks in the system can access a segment whose descriptor resides in the GDT. This mode of sharingis especially useful for operating-system databases. Many operating-system procepures can be calledfrom any task; they can access system data only if that data resides in segments accessible to everytask.Normally, the system designer decides in advance which descriptors are to reside in the GDT andwhich in LDTs, and uses the Builder to install them in the appropriate descriptor table. The onlysupport required from the operating system is to provide synchronization for access to the shared data.It is not always desirable to use GDT descriptors for sharing segments that only a few tasks use. Asegment that has a descriptor in the GDT is accessible by all tasks, and exposing it to access fromunrelated tasks may compromise the system's protection goals. Deletion of GDT descriptors may haveunknown effects, because it is diffucult to control usage of GDT descriptors. GDT space may be neededfor other purposes.Sharing via Common LDTWhen two (or more) tasks share most of the segments accessible to either one, then it is feasible forthem to actually use that same LDT. Figure 5-1 illustrates how to share an LDT by placing the GDTselector of the LDT in the LDT field of the TSS of each task.LDT sharing is appropriate if the sharing tasks are designed to cooperate, and if you are willing to takethe risk that a failure in one task might adversely affect the other tasks that use the same LDT.5-1 121960-001

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!