���������� ����������������� &���'�'�&������(��")�� ����������� * �$������+���������$�����'�+������+��� '��, ��������� �� ������������������������� �� --������'�+��������� .����/�����01 .����/����201 --���''��$�����������$���"����� ������������ �����)�/����201 �����)�/��))01 ���������������� ��������� 3�.$�)��/����01 !�"������# �$ %����� 1 2 &���'�'�&������(��")���/����40 &���'�'�&������5 �������$������)� * �$������+���������$��+�����������+��� * �$������+���������$�����'�+������+��� ��� �����67%���))6�1 '��, '��, --������'�+��������� .����/��))01 .����/����201 .����/����201 ���/�����8��0, --���''��$�����������$���"����� --�����������������������"����� ��������1���))991 3 �����)�/����201 �����)�/����201 �����)�/�����01 3�.$�)��/����01 --��+��������$��������'����� 3�.$�)��/����01 3 4 &���'�'�&������5 �������$������)� &���'�'�&������5 �������$������)� � :: * �$������+���������$��+�����������+��� * �$������+���������$�����'�+������+��� ��� �����67%���))6�1 '��, '��, --������'�+��������� .����/����201 .$�)��/������66��0,3� ���/��))8�0, .����/����201 --�����������������������"����� --���''��$�����������$���"����� ��))��1������991 ��������1���))991 3 �����)�/����201 �����)�/����201 3�.$�)��/����01 --��+��������$��������'����� 3�.$�)��/����01 5 6 1
&���'�'�&������5 �������$������)� � :: &���'�'�&������5 �������$������)� * �$������+���������$��+�����������+��� * �$������+���������$�����'�+������+��� '��, '��, .$�)��/��))�66��0,3 --������'�+��������� .����/����201 .����/�����01 --�����������������������"����� --���''��$�����������$���"����� ��))��1������991 �����)�/��))01 �����)�/����201 3�.$�)��/����01 --��+��������$��������'����� 3�.$�)��/����01 7 8 &���'�'�&������5 �������$������)� ;��'����<�������(��")�� * �$������+���������$��+�����������+��� * �$������+����������.���������+��� '��, '���, .����/��))01 .����/.��0�1 --�����������������������"����� �����)�/�����01 --����.������������������' --��+��������$��������'����� �����)�/.��0�1 3�.$�)��/����01 3�.$�)��/����0 9 10 ;��'����<�������(��")���/����40 =������($�)����$����(��")�� * �$������+�������������'������+��� • Five philosophers spend their time eating and thinking. '���, • They are sitting in front of a round table with .����/����20�1 spagett served. ���'��+���� 99�1 •There are five plates at the table and five ���/���'��+���� 66��0��.����/.��0�1 chopsticks set between the plates. �����)�/����20 • Eating the spaghetti requires the use of two --����'���������������' chopsticks which the philosophers pick up one at a time. .����/����20�1 •Philosophers do not talk to each other. ���'��+���� � � 1 •Semaphore chopstick [5] initialized to 1 ������'��+���� 66��0�������)�/.��0�1 �����)�/����20�1 3�.$�)��/����0 11 12 2
Recommend
More recommend