Главная » Просмотр файлов » Concepts with Symbian OS

Concepts with Symbian OS (779878), страница 15

Файл №779878 Concepts with Symbian OS (Symbian Books) 15 страницаConcepts with Symbian OS (779878) страница 152018-01-10СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 15)

For example, a program is a passive entity; a processAN OVERVIEW OF THE PROCESS MODEL63is an active entity. A program can be thought of as the definition ofa process; several processes that derive their definitions from the sameprogram may be running on a computer. Each of those running processes,although associated with the same program, is different and unique. Theseprocesses would have the same text section, but their data sections wouldbe different.Process stateAs it executes, a process is said to be in one of several states (seeFigure 4.1). The state of a process is defined by what the process is doingat any given moment. We define process states as follows:• new : a process being created is in the new state – its text section isconstructed from the code in a program; its data section and stack areallocated in memory; and hardware components are initialized• ready : a process in the ready state is available for running on aprocessor but waiting for execution• running : a process in the running state is executing on a processor – itis manipulating the hardware allocated to it and the system is beingaltered according to its instructions• waiting : a process in the waiting state is suspended and waiting forsome external event to occur; the external event could be anythingfrom receipt of an interrupt to the completion of an I/O request• terminated : a process in the terminated state has completed its execution on a processor; when a terminated process is removed fromsystem tables and data storage, it ceases to be a process.Notice that the arcs in Figure 4.1 are labeled with the operation thatis performed to move a process between the states at either end.

Forexample, a process moves from ‘new’ to ‘ready’ through the process ofcreation. Notice, too, that the diagram describes the path taken betweenstates. A process cannot move from the ‘new’ state immediately to a‘running’ state. Likewise, a process cannot be waiting for an externalevent and move directly to the ‘terminated’ state.

Finally, it is importantto realize that, while only one process can be running on a singleprocessor at any given moment, many processes can be in the ‘waiting’and ‘ready’ states.64PROCESSES AND THREADSdatecrescheduReadyinterrupNewtedledRunningexitTerminatedeventcompletedWaitingFigure 4.1I/O or eventwaitProcess statesProcess control blockThere are several system components associated with a running process.These components are recorded by the operating system in a processcontrol block (PCB), as shown in Figure 4.2.

The PCB contains andrecords the various pieces of information that represent a process to theoperating system.The components of a PCB can be described as follows:• process state : the current state of the process as it is manipulated bythe operating system• process ID : an identifier – usually an integer – that uniquely identifiesthe process in the system• program counter : the program instruction being executed• CPU registers : other registers used by the executing program• parent ID : the identifier of the process’s parent process• children IDs : the identifiers of the process’s child processes• scheduling information : information pertinent to how often the process can use the processor• memory management information : this information is important forthe protection of memory areas; it includes the values of the base andlimit registers, page table identifiers, etc.• accounting information : timing information used by the operatingsystem, including the amount of time used by the process and thelimits on execution• I/O status : the status of I/O devices that are being used by the process.AN OVERVIEW OF THE PROCESS MODEL65process stateprocess IDprogram counterCPU registersparent IDchildren IDsscheduling infomemory management infoaccounting infoI/O statusFigure 4.2A process control blockThe PCB represents all facets of a process to the operating system.

Asinformation about processes is stored by the operating system, the PCBserves as the unit of storage. Each process, therefore, has its own PCBand, implied by looking at a PCB, its own set of registers, memory space,accounting entries, I/O interactions, and so forth.Process schedulingA process moves through all the states in Figure 4.1 while executingon a system.

However, as we stated before, a process shares the CPUwith all other processes that are in the ready state. The operating systemscheduler is the element in an operating system that takes a process fromthe ready queue and allows it to execute for a while. The act of moving aprocess from state to state and eventually to termination is called processscheduling.66PROCESSES AND THREADSAs processes are created and enter the ready state, they enter a queuecalled the ready queue.

The job of the scheduler is to take processesfrom this queue and allow them to execute for a time. This queue isrepresented in the operating system as a linked list of PCBs (we can thinkof each PCB as being augmented to include pointers to implement thislinked list). All processes in the list that represent the ready queue areready to execute.The act of scheduling is represented by the removal of the head ofthe ready queue. Once a process is finished executing on the CPU, itis removed from execution. There are several ways to be removed fromexecution: a process could have exhausted the time slot it has been givenor it could be blocked while waiting for an I/O event.

The process’sPCB is placed in the appropriate queue to await more processing. Thereis, therefore, more than one queue in a system. Processes waiting forexternal events are placed in a device queue. Each device has its ownqueue. Processes could be waiting for a system event not tied to a device,since there is an event queue for these processes.So moving between states in an operating system amounts to movingPCBs between queues. A scheduler, then, moves processes from theready queue to execution and from execution to one of the queueson the system. Scheduling requires working with many aspects of theoperating system many times over.

Chapter 5 deals with the intricacies ofscheduling in more detail.Implementation conceptsFigure 4.1 shows that processes must be created to enter the system.When it is created, a process is given a unique identifier, a process ID.The process ID, usually an integer, makes this process accessible in thetable of processes running on the system.A process must be created by the operating system – operating inkernel mode – or by another process. This relationship between processesis often characterized as a parent–child relationship.

Parents create childprocesses, which go on to create other child processes, and so on. Theentire collection forms a kind of family tree.This hierarchical relationship is exploited in a number of ways. Forexample, it is typical that if a process receives an interrupt, then itschildren also receive that interrupt. It is also typical that a parent processcannot terminate until its children have terminated (while this behaviorcan be changed by system calls, it is the default behavior).AN OVERVIEW OF THE PROCESS MODEL67A zombie process is ready to terminate but for some reason cannotinform its parent of its termination.

This could happen if the parent processwas aborted for some reason. The child process tries to inform the parentof its termination and waits for the parent to respond. Since no response isforthcoming, the child process stays forever in the waiting state. It cannotterminate, but it cannot move to the ready state to be executed. Suchprocesses are not unusual on large systems with much activity.ThreadsAs an executing program, a process has a rather large ‘footprint’ on acomputer system. It commands a system’s resources and acts like it is theonly program being run on a computer. Its PCB might take up quite a bitof process-table space and it might take a lot of time to move the processinto and out of the running state. One of the components of a processis the thread of control – the set of instructions being executed on behalfof the program.

This thread is orchestrated by the program counter andrepresents an executing program.Consider the situation where a process has multiple threads of control.The other parts of the process remain the same: one PCB governingthe process’s information, one memory space, one set of accountinginformation, and so forth. Now, within a single structure, a process couldrun multiple tasks at one time with these multiple threads of execution.These tasks share the resources represented in a process’s structureand would have to do so carefully.

Характеристики

Тип файла
PDF-файл
Размер
1,2 Mb
Материал
Тип материала
Высшее учебное заведение

Список файлов книги

Свежие статьи
Популярно сейчас
Почему делать на заказ в разы дороже, чем купить готовую учебную работу на СтудИзбе? Наши учебные работы продаются каждый год, тогда как большинство заказов выполняются с нуля. Найдите подходящий учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6353
Авторов
на СтудИзбе
311
Средний доход
с одного платного файла
Обучение Подробнее