{"id":1669,"date":"2023-11-22T15:21:25","date_gmt":"2023-11-22T14:21:25","guid":{"rendered":"http:\/\/oopm.org\/?page_id=1669"},"modified":"2024-11-26T14:31:57","modified_gmt":"2024-11-26T13:31:57","slug":"8-active-objects","status":"publish","type":"page","link":"https:\/\/oopm.org\/?page_id=1669","title":{"rendered":"13. Active objects and parallel programming"},"content":{"rendered":"<div class=\"pdfprnt-buttons pdfprnt-buttons-page pdfprnt-top-right\"><a href=\"https:\/\/oopm.org\/index.php?rest_route=wpv2pages1669&print=pdf\" class=\"pdfprnt-button pdfprnt-button-pdf\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/oopm.org\/wp-content\/plugins\/pdf-print\/images\/pdf.png\" alt=\"image_pdf\" title=\"View PDF\" \/><\/a><a href=\"https:\/\/oopm.org\/index.php?rest_route=wpv2pages1669&print=print\" class=\"pdfprnt-button pdfprnt-button-print\" target=\"_blank\"><img decoding=\"async\" src=\"https:\/\/oopm.org\/wp-content\/plugins\/pdf-print\/images\/print.png\" alt=\"image_print\" title=\"Print Content\" \/><\/a><\/div>\n<p class=\"wp-block-paragraph\">A computer may execute many activities in parallel, which means they take place at the same time. This is possible since a computer may contain a number of processing units called CPU&#8217;s or cores. Each core may execute an activity. A core may also share its processing time between a number of activities in a way that leaves the impression that they execute in parallel &#8211; this is called <em>time-slicing<\/em>.  Activities executed in parallel are often referred to as <em>parallel process<\/em>es and\/or <em>concurrent processes<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A system of several computers connected in a network is another example of a system where activities are executed in parallel. This is referred to as <em>distributed computing <\/em>and\/or <em>distributed processes<\/em>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The writing of programs that execute just one activity is called <em>sequential programming <\/em>and the activity generated by the program is called a sequential process.. <\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the real world there are many example of systems where several active entities\/agents work together on a common taks. This may be a group of people and machines building a bridge, a public office handling cases, &#8230;  Such systems are complex in the sense that the entities have to coordinate their work and exchange information.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The ability of a computer to execute activities in parallel has many advantages. It may reduce the time for computing a given task. By splitting a given task into subtask that can be executed in parallel, may speed up computation compared to execute them in some order. However, there is an overhead in splitting up a task since these tasks may have to coordinate their activities. This means that the execution time of the subtasks must be larger than the time to coordinate the tasks.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The splitting of a task into subtasks may be the job of the programmers, but for some languages, the compiler behind the scene may split parts of a sequential program into subtasks that may be executed in parallel.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Another reason to consider parallel programming is that the environment consists of a number of devices, like computers, servers, and I\/O-devices that all execute activities, and these cannot be replaced by a sequential program.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We refer to the above situations\/cases for splitting a task into subtasks by the following terms:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><em>Hidden<\/em>: made by the compiler<\/li>\n\n\n\n<li><em>Exploited<\/em>: made by the programmers.<\/li>\n\n\n\n<li><em>Inherent<\/em>: the system and its environment consist of devices executing in parallel.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">In this book, we do not consider the hidden-case.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In this chapter, we will show how to describe parallel activities in a programming language. Parallel programming is a difficult task. This is partly due to the complexity of such systems, which makes it difficult for a single programmer or even more programmers to understand what goes on. Another reason is that the state-of-art for programming languages supporting parallel activities is not very well developed.<\/p>\n<div style=\"display:flex; gap:10px;justify-content:center\" class=\"wps-pgfw-pdf-generate-icon__wrapper-frontend\">\n\t\t<a  href=\"https:\/\/oopm.org?action=genpdf&amp;id=1669\" class=\"pgfw-single-pdf-download-button\" ><img src=\"https:\/\/oopm.org\/wp-content\/plugins\/pdf-generator-for-wp\/admin\/src\/images\/PDF_Tray.svg\" title=\"Generate PDF\" style=\"width:auto; height:45px;\"><\/a>\n\t\t<\/div>","protected":false},"excerpt":{"rendered":"<p>A computer may execute many activities in parallel, which means they take place at the same time. This is possible since a computer may contain a number of processing units called CPU&#8217;s or cores. Each core may execute an activity. A core may also share its processing time between a number of activities in a [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":21,"menu_order":13,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1669","page","type-page","status-publish","hentry"],"mb":[],"mfb_rest_fields":["title","gutenberg_elementor_mode"],"_links":{"self":[{"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages\/1669","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oopm.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1669"}],"version-history":[{"count":87,"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages\/1669\/revisions"}],"predecessor-version":[{"id":9866,"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages\/1669\/revisions\/9866"}],"up":[{"embeddable":true,"href":"https:\/\/oopm.org\/index.php?rest_route=\/wp\/v2\/pages\/21"}],"wp:attachment":[{"href":"https:\/\/oopm.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1669"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}