-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquestions.html
More file actions
69 lines (67 loc) · 2.38 KB
/
questions.html
File metadata and controls
69 lines (67 loc) · 2.38 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Questions</title>
</head>
<body>
<ol>
<li>
<p>
There are several differences, but I think that the most relevant one is that a class can have functions
attached to it, called methods. A struct can not have it.
</p>
</li>
<li>
<p>
Once more, there are several differences. For example, an array has fixed size (once we initialise it,
it cannot be resized) but a vector is dynamic (its length increase when pushing elements inside). Moreover,
vector is <em>NOT</em> index based.
</p>
</li>
<li>
<p>
It is similar to malloc or calloc, it is a request for memory allocation.
</p>
</li>
<li>
<p>
There exists a design pattern called <em>singleton</em> which is based on restricting the creation of a
class to one unique object (that is, a singleton. In mathematics, a singleton is a set containing only one
element, so this definition mimics the classical one).
</p>
</li>
<li>
<p>
To divide a <em>big</em> task into <em>smaller</em> ones, each of them treating different data but
performing the same operation on it. For example, there exists parallel algorithms for matrix
multiplication, this increase its speed almost x NUM_OF_CORES of our machine.
</p>
</li>
<li>
<p>
A thread is a segment of a process. Moreover, a process tends to be isolated, whereas threads share memory.
</p>
</li>
<li>
<p>
Using IPC (Inter Process Communication), which is a mechanism of an operating system to allow the processes
to manage shared data.
</p>
</li>
<li>
<p>
A deadlock is a condition where a program cannot access a resource it need to continue. A race condition
occurs when two or more threads can access shared data an they try to change it at the same time, resulting
in a undefined behaviour of the process.
</p>
</li>
<li>
<p>
<em>git fetch</em> downloads the data from a remote repository but do not apply them to our local one.
<em>git pull</em>, instead, do that task.
</p>
</li>
</ol>
</body>
</html>