DEV Community

ivinieon
ivinieon

Posted on

Review posting

1. Basic coding words

Object has states and behaviors.
Class describes the attributes and behaviors of the object.
instantiate: creating an object using the "new" keyword.
(Class는 새로운 object를 만드는 것이고 그 만드는 것을 instantiate라고 한다.)
Class 안에는 attributes, methods 들이 있고, 이 class에서 만든 object들은 이 attributes들과 methods를 가진다.

primitive type is predefined by the language such as int or boolean. If the Class creates a new object, it has the class type which was defined in the Class.

2. Relationship between Variables, Objects, and Memory

Application is a set of commands that a computer can execute to provide functions for the users.
Memory is the place where the executed application resides. Memory allocated to the application is internally divided into several areas.
Identifier: name given to entity(이름)
Variable: name given to location(실제 메모리 위치)
CPU is the computational unit that executes commands.

Stack memory
Whenever a function or method is called, a stack frame is stacked in the stack memory.

Heap memory
Heap memory is used during the creation of an object, and stack memory is also used for it. However, in the stack memory, there is "this" which points to the heap memory's address.

3. How can multiple programs be executed?

Process is a program that is running on a computer. Each process is assigned an independent memory space.
Thread is a unit of execution. A process can have more than one thread.

Multi-tasking: The multiple processes and threads are sharing a core and executing very short CPU time slices alternatively.
Multi-processing: A system that utilizes two or more processors or cores.
Multi threading: A single process executes multiple tasks(dual threads) simultaneously. Each core executes one task in parallel.

4. What is context switching?

Context Switching
The process of replacing a running process/thread with another process/thread on a CPU/core.
- Process context switching
→ additional processing related to virtual memory addresses is performed. MMU TLB

- Thread context switching
→ memory-related processing is not needed because memory is shared within the same process

Top comments (0)