computer networks – Programmerbay https://programmerbay.com A Tech Bay for Tech Savvy Sun, 21 Jun 2020 17:14:55 +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 computer networks – 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 Analog and Digital signal https://programmerbay.com/difference-between-analog-and-digital-signals/ https://programmerbay.com/difference-between-analog-and-digital-signals/#respond Sat, 10 Aug 2019 15:14:38 +0000 https://www.programmerbay.com/?p=4524 When we talk about networking, the concept of transferring information or data over a network usually comes in our mind. This happens with the help of the signals. These signals are used to carry information from one device to another efficiently.

There are 2 types of signals:

  • Analog Signals
  • Digital Signals

Analog signals

The analog signals can be described as the continuous waves. These continuous waves changes with respect to the time. The analog signals are represented by the sinusoidal waves.

Analog signal

Digital signals

The digital signals can be described as discrete waves. These discrete waves have only two phases, that is, 0 or 1. The digital signals are represented by the square waves.

digital signals

Difference between Analog and Digital Signals are given below:

BasisAnalog signalsDigital signals
DefinitionIt can be defined as the continuous wave that always changes with respect to timeIt can be defined as the discrete wave that always has a binary nature
BandwidthLowHigh
RepresentationThe sinusoidal wave correctly represents the nature of an analog signalSquare wave correctly represents the essence of the digital signal
Signal DistortionWhen noise occurs due to amplifier during transmission, there are more chances to have distortionLow chances of having distortion during transmission
Technical aspectFrequency, Amplitude, time period and phase completely describes technical aspectThe Bit intervals (period) and Bit rate (instead frequency) are used to describe the technical aspect
Signal RangeThey do not have any kind of fixed rangeFixed and finite range, which are 0 and 1 specifically
Data TransmissionTransmit the data in the form of wavesRequired to convert the transmitted data in the binary form, namely 0s and 1s
ExampleThe most suitable example for the analog signals could be the natural sound in our surroundingsThe most suitable example for the digital signals could be Mobile phones and other electronic devices
SecurityLess secureHighly secure as it can be encrypted
CostLowHigh, required device for conversion

Key Differences

  • GENERIC

An analog signal can be defined as the continuous wave that always changes with respect to time; whereas; The digital signal can be defined as the discrete wave that always has a binary nature (0 or 1).

 

  • GRAPHICAL REPRESENTATION

The sinusoidal wave correctly represents the nature of an analog signal; whereas; The square wave correctly represents the essence of the digital signal.

 

  • TECHNICAL DESCRIPTION

Frequency, Amplitude, Phase and Period completely describes the nature as well as the technical aspect of the analog signal; whereas; The Bit intervals, Bit rate, etc. efficiently describes the technical aspect as well as the nature of digital signals.

 

  • SIGNAL RANGE

When it comes to signal range for the analog signals then, they do not have any kind of fixed range; whereas; When it comes to the signal range for the digital signals then, they have fixed and finite numbers, which are 0 and 1 specifically.

 

  • SIGNAL DISTORTION

For analog signals the concept of signal distortion is directly proportional to the nature of the signal, that is, the analog signals are usually more prone to distortion; whereas; For the digital signals the concept of signals distortion is also directly related to the nature of the signal, that is, the digital signals are mostly less prone to distortion.

 

  • DATA TRANSMISSION

The data transmission is one of the most important factors for the signals; the analog signals always transmit the data in the form of waves; whereas; the digital signals always transmit the data in the binary form, namely 0s and 1s.

 

  • EXAMPLE

The most suitable example for the analog signals could be the human voice; whereas; the most suitable example for the digital signals could be the transmission in a computer.

]]>
https://programmerbay.com/difference-between-analog-and-digital-signals/feed/ 0