operating system – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Mon, 04 Jul 2022 06:41:08 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://programmerbay.com/wp-content/uploads/2019/09/cropped-without-transparent-32x32.jpg operating system – Programmerbay https://programmerbay.com 32 32 Difference Between Multitasking And Multithreading in Java https://programmerbay.com/difference-between-multitasking-and-multithreading/ https://programmerbay.com/difference-between-multitasking-and-multithreading/#respond Sun, 25 Aug 2019 09:03:10 +0000 https://www.programmerbay.com/?p=2643 In programming, Multitasking and multithreading are two approaches used to reduce the response time and increase the throughput of overall program.

The main difference between them is, one involves execution of multiple processes simultaneously and other one associates with execution of multiple threads of a process concurrently.

Difference Between Multitasking And Multithreading in Java

MultitaskingMultithreading
CPU executes two or more processes at the same timeCPU executes various threads of a particular process simultaneously
It involves switching between various processes concurrentlyIt involves switching between various threads of a single process concurrently
Each and every process gets definite resources and a separate memory spaceThreads share the same resource and memory space which is occupied for that very process
It is slower than multithreading as it puts overhead over CPUIt is faster than multitasking as it don't put much overhead over CPU

Key differences

  1. GENERAL

In case of multitasking, the system can perform or execute various activities or programs at the same time, by switching frequently between various tasks that are provided by the user.

In case of multithreading, the system can pay attention or execute the various threads of a particular process simultaneously, which makes the process run more efficiently.

  1. NATURE OF SWITCHING

In case of multitasking, the switching is performed by the CPU and is performed by rapidly switching between various processes in the time which allotted to each process or program by the CPU.

In case of multithreading, the switching is also performed by the CPU and is performed between the threads of a particular process by switching seamlessly and simultaneously.

  1. RESOURCE AND MEMORY

In case of multitasking, the process which needs to be executed by the CPU has to be provided with a definitive resource and allocated to a particular memory.

In case of multithreading, the various threads actually share the memory which has been allotted to the complete process beforehand and also share the resources which were reserved for that very process.

4. MULTI PROCESSING

When we talk about Multitasking, then multiprocessing happens to be a part of Multitasking.

But, when we talk about multithreading, then multiprocessing is not a part of the multithreading process.

5. HIERARCHY

If we talk about hierarchy, then the Multitasking phenomenon is above or the parent element for the multithreading phenomenon.

When we discuss the term, Multithreading then this must be kept in mind that it is a subpart of the Multitasking phenomenon.

6. COSTLIER

The Multitasking activities are more costlier than the Multithreading ones because the hardware dependence is more for the multitasking phenomenon which directly increases the cost for efficient performance.

The Multithreading activities are less costlier than Multitasking, this is because these are based on scheduling which is completely based on the software front and can be customized for almost all scenarios.

 

Multitasking:

When a machine or computer performs a variety of activities such as tasks, programs, etc. simultaneously then, this is termed as Multitasking. Multitasking is performed by allocating small slice of CPU time to each process and switching them back and forth to create the illusion of parallel execution.

multitasking

In other words, a CPU performs activities for a particular duration and then again changes. This process is so rapid that the user cannot tell any difference.

Each tasks uses memory and other resources. Therefore, multiple tasks put overhead on CPU and if there are too many tasks in execution , the speed of the system gradually slows down.

 

Multithreading:

A thread is the smallest form of a process and a process can have a varied range of threads.

multithreading

The process of executing multiple threads simultaneously is known as multithreading. It can be viewed as multitasking at programmatic level. It aims at reducing the execution time of a program and helps in obtaining efficient program

It can be used in a various scenario such as maintaining the responsiveness of application in the long run, parallel execution of two different tasks, handling client’s request in case of the Web application and more.

 

]]>
https://programmerbay.com/difference-between-multitasking-and-multithreading/feed/ 0
Difference between HarmonyOS and Android https://programmerbay.com/in-what-ways-harmonyos-can-give-competition-to-android/ https://programmerbay.com/in-what-ways-harmonyos-can-give-competition-to-android/#respond Mon, 12 Aug 2019 11:25:06 +0000 https://www.programmerbay.com/?p=4598 What is HarmonyOS?

  • Huawei has unveiled its latest operating system named HarmonyOS for its upcoming Huawei devices.
  • HarmonyOS is disclosed as the world’s first micro kernel based distributed OS for all scenarios.
  • It has distributed architecture, meaning it would provide a secure kernel and can enable a shared ecosystem.
  • This OS is targeted for IoT services. Some of the services provided by HarmonyOS are power vision, wearable services, hat unit services, speaker services, and Smartphone services. All these services can be supported by HarmonyOS making it an all scenario OS.

In what ways HarmonyOS can give competition to Android?

  • Both Harmony and Android operating systems are open source.
  • Harmony can run on multiple types of devices just like Android which also runs on smartphones, smart TV, smartwatch etc.
  • Through this OS for all scenarios of HarmonyOS, it targets to create an ecosystem of its own just like Android is in the current market.
  • HarmonyOS is a lightweight system which gives a performance boost to multiple applications at once.
  • HarmonyOS is based on a deterministic latency engine which helps in better allocation of system resources using real-time analysis and forecasting, whereas Android is based on the Linux kernel’s scheduling mechanism which has fair scheduling model.
  • HarmonyOS’s microkernel can support true high-performance graphics.

HarmonyOS vs. Android

  • HarmonyOS is based upon micro kernel based distributed system whereas Android OS is based upon Linux kernel at its core.
  • HarmonyOS doesn’t give root access to its users whereas, in Android, we can root our smartphones.
  • HarmonyOS have very little to offer in terms of apps. Huawei has to invest heavily in getting developers interested in building apps in their OS. On the other hand, Android already has a big market.

Can HarmonyOS be an alternative for Android OS?

Let’s look at some examples.

  • Samsung came up with its own OS known as Tizen which is a Linux based mobile operating system. They developed this OS to compete with the Android OS. It is also open-source software. In the current market, Tizen OS is just being used in the galaxy wearables only, not in the smartphones or other devices.
  • Windows came up with its own OS known as Windows Phone (WP) for smartphones. Despite its emphasis on productivity and security, it failed against Android.

Now the Huawei’s HarmonyOS. This OS can give rather strong competition to Android but it may have to do more than building its own ecosystem.

]]>
https://programmerbay.com/in-what-ways-harmonyos-can-give-competition-to-android/feed/ 0
Difference between user mode and kernel mode https://programmerbay.com/difference-between-kernel-and-user-mode/ https://programmerbay.com/difference-between-kernel-and-user-mode/#respond Mon, 01 Apr 2019 16:41:42 +0000 https://www.programmerbay.com/?p=2641 An operating system can have various modes of operation and these modes define standardised instructions for deciding what resources can be accessed, limit memory access and more in order to protect data and provide system security.

There are two types of modes, User Mode and Kernel Mode. A kernel mode is also known as supervisor mode.

kernel mode and user mode

User mode

It has restricted access to the resources. CPU has restrictions, therefore, it can have only access to limited instructions and memory. Utility applications such as text editor, media player are run in this mode.

When an application or program is executed, its initial state and operation mode are loaded on stack. At this point, CPU starts executing the program in this particular mode. Interrupts and traps are used to signal  or flag the CPU to switch back to Kernel mode and do the essential tasks by storing the current state of the user program to the stack again. After completing it, CPU resumes the program from where it left.

Kernel Mode

It has full access to memory, I/O and other resources. In this, CPU can execute any instructions and have full access to underlying hardware. The core functionalities of the operating system always run in Kernel mode.

Having these authorities, processes using this mode have full rights to access resources, allowing them read/write to the storage media, enable and disable hardware and more. Difference between Kernel Mode and User Mode :

BasisKernel ModeUser Mode
PermissionUnrestricted and full permissions to access the system's hardwareRestricted and limited permissions to access the system's hardware
Memory referenceIt can reference to both the memory spacesIt can only reference to memory space that is dedicated to user mode
AccessOnly core functionality can be allowed to operate in this very modeUser applications can access this mode for a particular system and is allowed to operate in this particular mode
System crashFatal and increases the complexityRecoverable and can simply restart the session
Also Known Privileged mode or Supervisor mode Restricted mode

Key Differences:

  1. The mode in which there is an unconditional, unrestricted and full permission to access the system’s hardware by the current executing piece of code is known as the kernel mode. The mode in which there is no means of accessing the system’s hardware directly by the current piece of code is also known as the user mode.
  2. The kernel mode is a very powerful and impactful mode which means that it can refer to any memory block of the system and can also orders to execute an instruction to the CPU. The user mode is standardized and normal viewing mode which means that it cannot reference to any memory block or execute any information on its own as it requires some Application Protocol Interface (API) to do these tasks.
  1. The kernel mode is the most unrestricted and candid mode that a system can have which means that only the trustable sources can be allowed to operate in this very mode. The user mode is more like a generic mode that can have, which means that any user can access this mode for a particular system and is allowed to operate in this particular mode.
  1. As the kernel mode is very important and candid this means that if the system crashes in this mode then it could be very fatal and increases the complexity. As the user mode is quite general and user-friendly this means that even if the system crashes in this mode then it is not fatal at all and can simply restart the session.
  1. The kernel mode is very crucial to the system as well as the system programmer so everything that runs easily runs on your PC might not run here because its purpose is to employ hardware for a particular task. The user mode is user friendly space where all the general code will definitely execute.

]]>
https://programmerbay.com/difference-between-kernel-and-user-mode/feed/ 0