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.

DATA SHARING, ALIASING, AND SYNCHRONIZATIONsegments. If there are call gates in the GDT at PL 3, then these procedures are accessible to all otherprocedures in the system.SEND_MESSAGE fills a message with the specified data and descriptors, removes the descriptorsfrom the descriptor table, and links the message at the tail of the message queue. If a task is waitingat the mailbox, SEND_MESSAGE causes it to be linked into the ready queue so that it will find themessage the next time it is scheduled to run.If RECEIVE.-MESSAGE finds no messages waiting at the mailbox, then it links"the task into a waitingqueue. The task queue threads through the task database. The task will continue executing when anothertask sends a message to the mailbox. If (or when) a message is waiting, RECEIVE_MESSAGE writesthe data portion of the message at a specified location in the receiving task's space and installs thedescriptor portion in specified slots in one of the receiving task's descriptor tables (GDT or LDT).These examples do not include management of space and queues for messages because conventionalalgorithms apply. .External procedures GELMSG~PACE, ENQUEUE_MESSAGE,DEQUEUE_MESSAGE, and FREE_MSG_SPACEprovide these functions.Special handling is required to accommodate the fact that a descriptor in a message is temporarily notin any descriptor table. There are two cases to consider: .• The descriptor is the sole descriptor for the segment. In this case, no changes can be made to thesegment because it is temporarily inaccessible. You should take care that no failure in the communicationprocess causes the descriptor to become lost. A memory area without a descriptor cannotbe freed.• The descriptor is an alias (Le., one of several descriptors for the same segment). Since the segmentis (presumably) accessible via the other aliases, it is possible for some task to request some operationon the segment during the time the descriptor in the. message is absent from any descriptor table.Normally, the operating system updates all aliases when it makes any major changes to a segment(for example, relocation or swapping to secondary storeJ~ This is not possible (given the aliasingscheme previously presented in this chapter) when the alias is not in a descriptor table. To solve theproblem, this example assumes there are two procedures;a. DISABLRALIAS..YTR that marks the alias list element to indicate to the alias manager thatthe alias is in a mailboxb. FI~LIAS..YTR that, when the message is delivered, updates the alias pointer with the newlocation of the alias and with any segment information that may have changed while the aliaswas absent from the alias list.Dynamic systems may need to create and delete mailboxes dynamically. The only difficulty in creatinga mailbox is ensuring that no task uses it while it is being constructed. (The next section considers thisproblem.) To delete a mailbox the operating system must awaken any tasks that are waiting for messages,delete any descriptors (aliases) that reside in undelivered messages, and delete the undelivered messagesthemselves.The operating system may, as part of the process of task creation, give each task at least one mailbox.If the mailbox feature is the only means of passing aliases among tasks, a task cannot receive an aliasfor a mailbox unless it already has a mailbox. Some operating system designs may require every taskto have a mailbox for such purposes as receiving memory segments from the memory-allocation module.5 .... 12 121960-001

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

Saved successfully!

Ooh no, something went wrong!