Шукаєте відповіді та рішення тестів для ECS518U - Operating Systems - 2025/26? Перегляньте нашу велику колекцію перевірених відповідей для ECS518U - Operating Systems - 2025/26 в qmplus.qmul.ac.uk.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
Consider the following code which uses Python to call the ‘fork’ system call.
pid = os.fork()
if (pid == 0) :
# case 1
else :
# case 2
Select all of the following statements that are true (incorrect selections will reduce your overall marks for this question).
Match the command to its description
Select all of the following that are true about race conditions, mutual exclusion, critical regions. Incorrect selections will reduce your overall marks for this question
Consider the following code which uses Python to call the ‘fork’ system call. Line numbers are given just for your reference.
1 x = -1
2 pid = os.fork()
3 time.sleep(1)
4 if pid == 0:
5 x = 0
6 print “The value of x is ” + str(x)
Select all of the following statements that are true (incorrect selections will reduce your overall marks for this question).
The following screen shot shows a terminal session on a Linux computer:
Use the evidence in the screenshot to select all of the following statements that are true. Incorrect selections will reduce your overall marks for this question.
The following statements are about creating threads in Java. Select all that are correct. Incorrect selections will reduce your overall marks for this question.
Consider the following output of the Linux stat command (some information from the output has been omitted but you won’t be asked about it).
[tassos@bert ~/test]$ stat hello.phpFile: ‘hello.php’Size: 88 Blocks: 8 IO Block: 4096 regular fileDevice: 24h/36d Inode: 21109162 Links: 1Access: (0644/-rw-r--r--) Access: 2026-01-24 00:06:41.903447371 +0000Modify: 2026-01-24 00:06:41.904447405 +0000Change: 2026-01-24 00:06:41.905447439 +0000
Based on this output, select all of the following that are true (incorrect selections will reduce your overall marks for this question).
A Mailbox class is to be used by multiple threads. The intended behaviour is:
- When the mail box is written, it becomes occupied. When the contents are read, the mailbox becomes empty.
- The write method is used to place something in the mailbox. The method should block if the mailbox is already occupied.
- The read method is used to extract something from the mailbox. The method should block if the mailbox is empty.
Consider the code below, which is not thread safe. Select all statements that are true. Incorrect selections reduce your overall marks for this question.
public class Mailbox <T>
{
private T contents ;
public Mailbox() {
contents = null ;
}
public void write(T entry) {
contents = entry ;
}
public T read() {
T temp = contents;
contents = null;
return temp;
}
}
Below you can find an incomplete concept map built around the 'System call' concept as we have discussed it in lectures. Match the labelled parts of the map with the correct concept or relationship.
Consider the following code which uses Python to call the Unix ‘fork’ system call.
pid = os.fork()
if (pid>0) :
# case 1
else :
# case 2
Select all of the following statements that are true (incorrect selections gain negative marks).