Posts

Showing posts from December, 2016

SQL vs NOSQL

Image
Differences between Sql and Nosql Database:

Proces vs Thread

Image
Process :   Is an executing instance of an application . They run in separate memory space unlike threads. To put it in simple terms, we write our computer programs in a text file and when we execute this program, it becomes a process which performs all the tasks mentioned in the program. Example: when you double-click the Microsoft Word icon, you start a process that runs word. Threads :   are path of execution within a process . Threads within the same process runs in a shared memory space . ----------------------------------------------------------------- ----------------------------------------------------------------- U may have heard process is heavy weight . actually when process is created Operating system creates a PCB (process control block) which includes may things like  process id - Unique identification for each of the process in the operating system. pointers  - A pointer to parent process. state -The current state...

TCP vs UDP

Image
✅ TCP is Connection Oriented while UDP is connection less. ✅ Udp small header size.(8 bytes) where in TCP is 20 bytes. So udp is faster. ✅ Both has Error detection . ✅ Udp has No Error recovery. so in most cases of UDP, the packet is just discarded . While TCP has a error recovery mechanism. ✅ Packets may arrive or out of order in UDP. ✅ No congestion control in UDP. Congestion control is handled in TCP when ever network is congested the the transmission is delayed. ✅ No acks or retransmissions in UDP ✅ Flow control in TCP not present in UDP flow control means if reciver is slow the transmitter must act accordingly. ⭐In conclusion UDP may be light weight but it is not reliable. TCP and UDP are Used in: SMTP -TCP(sending mail) IMAP/POP -TCP(reciveing mail) FTP -TCP SSH(secure shell) -TCP HTTP -TCP Telnet...

What is a Firmware ? Differences b/w Software, Hardware and Firmware ?

Hardware : It is a collection of electronic equipment’s which are assembled together to  work as a single unit. This arrangement is used to direct the flow of electricity in a desired manner. Software : Software’s are nothing but programs which are used to generally perform advance tasks with the same set of hardware.  For example:  every mobile phone have flash for taking photos in the dark places. But someone developed a software to keep the light on continuously, this gave us flash light support in our mobiles but remember the hardware was still the same. Firmware :   Firmware is a set of most basic instructions that can be passed to the hardware for its basic functioning . In other words, these are the instructions which sits between the software & the hardware. Yes they're stored on ROM to prevent unauthorized alterations. Recall the example of flashlight, the basic instructions to the hardware were to open the light for the purpose of flash onl...

What is Kernel ?

Image
1) What is Kernel? A kernel is the central part of an Operating system. It manages the tasks of the computer and the hardware. A kernel is the part of the operating system that mediates access to system resources. It's responsible for enabling multiple applications to effectively share the hardware by controlling access to CPU, memory, disk I/O, and networking. An operating system is the kernel plus applications that enable users to get something done (i.e. compiler, text editor, window manager, etc.).       

Memory Management (Contiguous and Non-Contiguous ).

Image
                MEMORY MANAGEMENT Background: Memory consists of a large array of words or bytes, each with its own address. The CPU fetches instructions from memory according to the value of the program counter. These instructions may cause additional loading from and storing to specific memory addresses. Just as processes share the CPU, they also share physical memory Memory management is subdividing memory to accommodate multiple processes.  Memory needs to be allocated to ensure a reasonable supply of ready processes to consume available processor time. Memory Allocation: There are two types of memory allocation techniques: Contiguous. Non - Contigous. 1.Contiguous Memory Allocation: Fixed size partitioning . Dynamic Partitioning . Fixed size partitioning -  (Causes internal fragmentation) : Each partition contain exactly one process. Degree of multiprogramming bound by # of partitions...

Threaded Binary Trees.

Image
                       Threaded Binary Trees. Node Format In Threaded Binary Trees: LTAG LEFT DATA RIGHT RTAG ⇒For Threaded Binary tree: if Ltag==0 ⇒ left points to inorder predecessor. if Ltag==1 ⇒ left points to left child. if Rtag==0 ⇒ right  points to inorder sucessor. if Rtag==1 ⇒ right points to right child. Find in-order sucessor in-order threaded binary tree: psuedo code to find in-order successor: threaded BT * p; if( rtag==0 ) {     successor is p->right; } else {    p=p->right;    while( p->ltag==1 )         p=p->left; } return p; Diagram:

How to execute RMI programs- Remote Method Invocation in Java

Image
RMI stands for "Remote Method Invocation", the technology of Java. RMI is nothing but communication between two JVMs loaded on two different systems. The RMI Architecture is very simple involving a client program, a server program, a stub and skeleton. In RMI, the client and server do not communicate directly; instead communicates through  stub  and  skeleton  (a special concept of RMI and this is how designers achieved distributed computing in Java). They are nothing but special programs generated by  RMI compiler . They can be treated as  proxies  for the client and server. Stub program resides on client side and skeleton program resides on server. That is, the client sends a method call with appropriate parameters to stub. The stub in turn calls the skeleton on the server. The skeleton passes the stub request to the server to execute the remote method. The return value of the method is sent to the skeleton by the server. The skeleton, as yo...

JVM, JRE, JDK and JIT ??

Image
JIT: Just in time (JIT) is a part of Java Virtual Machine (JVM) architecture. The job of JIT inside JVM is to compile bytecode into machine executable code in real time, on a piece-by-piece, demand basis. When Java programs are executed, JVM does not read the entire Bytecode and converts it  into machine instructions. If JVM tries to do this approach then the program execution  time will be delayed for hours. Java has overcome the latency of program execution  time by interpreting the required bytecode and keep the rest of the code aside. Just in time (JIT) helps to compile code that is only needed and at the same time boost  the program performance. Wheather the Java programs are interpreted traditional  way or on the fly the functionality and features like portability and security remains  the same. Summary: Java compiler converts the Java source code that you write into a binary  program...