CSE 775 – Distributed Objects Submitted by: Arpit Kothari

Slides:



Advertisements
Similar presentations
Categories of I/O Devices
Advertisements

Executional Architecture
Intel Do-It-Yourself Challenge node.js
By: Craig Hecock.  A JavaScript runtime environment running Google Chrome’s V8 engine ◦ a.k.a. a server-side solution for JS ◦ Compiles JS, making it.
N ODE.J S S ERVER S IDE J AVASCRIPT Diana Roiswati ( ) Ahmad Syafii ( ) Asri Taraqiadiyu ( )
© 2014 IBM Corporation Empowering the IBM ecosystem Introduction to Developing applications using node.js on Bluemix IBM Ecosystem Development Instructors.
Real-Time Kernels and Operating Systems. Operating System: Software that coordinates multiple tasks in processor, including peripheral interfacing Types.
JavaScript Event Loop Not yo mama’s multithreaded approach. slidesha.re/ZPC2nD.
Interesting facts about node.js.  Asynchronous I/O  How do they do that?..threads (usually) What do Web Servers do?
 A JavaScript runtime environment running Google Chrome’s V8 engine ◦ a.k.a. a server-side solution for JS ◦ Compiles JS, making it really fast  Runs.
Node.js - What is Node.js? -
Chapter 34 Java Technology for Active Web Documents methods used to provide continuous Web updates to browser – Server push – Active documents.
E X C E E D I N G E X P E C T A T I O N S OP SYS Linux System Administration Dr. Hoganson Kennesaw State University Operating Systems Functions of an operating.
Operating Systems David Goldschmidt, Ph.D. Computer Science The College of Saint Rose CIS 432.
Chat Room App Logan Linn Network Application Design Fall 2010.
Node.Js 1. 2 Contents About Node.Js Web requirement latest trends Introduction Simple web server creation in Node.Js Dynamic Web pages Dynamic web page.
Code Development for High Performance Servers Topics Multithreaded Servers Event Driven Servers Example - Game Server code (Quake) A parallelization exercise.
1 Why Threads are a Bad Idea (for most purposes) based on a presentation by John Ousterhout Sun Microsystems Laboratories Threads!
Background Computer System Architectures Computer System Software.
Learn Nodejs by Building 10 projects. What is Nodejs  An Open source, Cross platform, Event Based and Non-blocking framework used to develop server side.
Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.
1 Chapter 5: Threads Overview Multithreading Models & Issues Read Chapter 5 pages
CX Introduction to Web Programming
Parallel Programming in Contemporary Programming Languages
NodeJS and MEAN cs6320.
Node.Js Server Side Javascript
Physics validation database
Advanced Operating Systems CIS 720
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
Operating System.
WEB SERVICES.
Processes and Threads Processes and their scheduling
NodeJS and MEAN Prof. L. Grewe.
CS399 New Beginnings Jonathan Walpole.
CSE451 I/O Systems and the Full I/O Path Autumn 2002
Chapter 4 Threads.
3 Things Everyone Knows About Node JS That You Don't
Node.Js online Training at GoLogica.
Linternals SysInternals for Linux
Node.js talking to PROGRESS
Chapter 4: Threads.
Node.Js Server Side Javascript
2017, Fall Pusan National University Ki-Joune Li
Capriccio – A Thread Model
Parallel Programming in Contemporary Programming Languages (Part 2)
Distributed Systems - Comp 655
Chapter 15, Exploring the Digital Domain
A Comprehensive Study on Real World Concurrency Bugs in Node.js
Nathan Totten Technical Evangelist Windows Azure
CSE 451: Operating Systems Winter 2009 Module 13 Redundant Arrays of Inexpensive Disks (RAID) and OS structure Mark Zbikowski Gary Kimura 1.
Processes and Threads.
Secure Web Programming
CSE 451: Operating Systems Winter 2012 Redundant Arrays of Inexpensive Disks (RAID) and OS structure Mark Zbikowski Gary Kimura 1.
INTRODUCTION TO By Stepan Vardanyan.
Prof. Leonardo Mostarda University of Camerino
Operating System Introduction.
Threads David Ferry CSCI 3500 – Operating Systems
Why Threads Are A Bad Idea (for most purposes)
JavaScript CS 4640 Programming Languages for Web Applications
Introduction.
Why Threads Are A Bad Idea (for most purposes)
Why Threads Are A Bad Idea (for most purposes)
CS703 – Advanced Operating Systems
Concurrency: Threads, Address Spaces, and Processes
Concurrency in GO CS240 23/8/2017.
Web Application Development Using PHP
JavaScript CS 4640 Programming Languages for Web Applications
Threads CSE 2431: Introduction to Operating Systems
DIBBs Brown Dog BDFiddle
Presentation transcript:

CSE 775 – Distributed Objects Submitted by: Arpit Kothari Node.js | GO CSE 775 – Distributed Objects Submitted by: Arpit Kothari

I/O Need to be done differently

I/O Cycles I/0 LATENCY : L1 : 3 Cycles L2 : 14 Cycles RAM : 250 Cycles Disk : 41,000,000 Cycles NETWORK : 240,000,000 Cycles

Concurrency (A Comparison)

Concurrency (A Comparison)

Concurrency (continued) “BETTER SOFTWARES CAN MULTITASK” Q1. ) Is threading the only way? Q2. ) What is NGINX doing differently?

Concurrency (continued) “BETTER SOFTWARES CAN MULTITASK” Q1. ) Is threading the only way? - Context switching is not free - Each thread needs memory

Concurrency (continued) “BETTER SOFTWARES CAN MULTITASK” Q1. ) Is threading the only way? - Context switching is not free - Each thread needs memory Q2. ) What is NGINX doing differently? - Single thread & Event Loop

Node works on single thread Event loop with a “Non-Blocking I/O”

Google Chrome V8 JavaScript Runtime Understanding Node Can Build Scalable “Network” Applications using JavaScript on “Server”-side Fast processing – written in C Structure : Node.JS Google Chrome V8 JavaScript Runtime

Understanding Node What its not ! What it is Its not a web framework Its not a multi-thread Application What it is It is a low level communication network Single threaded Application Works with a non-blocking code (why ?)

Simple Blocking/ Non-Blocking var contents= fs.readFileSync (‘filePath’); console.log(contents); console.log(“Hmm…This takes time”); Non-Blocking : fs.readFile(‘filePath’,function(err,contents){ }); console.log(“hey..i can be executed before!”); Question : What happens with two Files ?

The Event Loop // This is why JavaScript is used var http=require (‘http’); http.createServer(function(request,response) { …………… }).listen(8080); EVENT LOOP KNOWN EVENTS Request

Event Loop Continued KNOWN EVENTS Request EVENT LOOP Connection EVENTS QUEUE Close Close Request

What if it was blocking code ?

Node.js Events

Events In Detail Imagine DOM (Document Object model) Triggers events (we can listen to those events and work on them eg. With jQuery!) Objects in Nodes also emit events, which inherit from the Event Emitter Constructor net Server Request Event EventEmitter FileRead Data Event EventEmitter

Example createServer Event : How does it attach to the event emitter ? http://nodejs.org/api/http.html

Node Examples RUN

Node Examples RUN

Node Examples RUN

Node Examples RUN

Go Language ______________________________

GO Go is an open source programming language that makes it easy to build simple, reliable, and efficient software. Go is a “Concurrent” language not “Parallel” language Concurrent Programming is structuring the program to deal with the real world problems. Concurrent Programming : composition of independently executing computations

A Simple Go Program package main import "fmt" func main() { fmt.Printf("hello, world\n") fmt.Printf("This works") } RUN

Concurrency in GO GO Routines Channels Select

GO ROUTINES

Go Routines Independently Executing Functions RUN Independently Executing Functions It has its own call stack Very cheap thread

Go Routines (continued) RUN Independently Executing Functions It has its own call stack Very cheap thread

CHANNELS

Go Channels A Channel in GO provides a connection between two go routines, allowing them to communicate It is a Synchronization operation Buffer Channels RUN

“Don’t communicate by sharing memory, Share memory by communicating”

SELECT

Go Select It is a control structure that allows you control the behavior of a program RUN

My Final Project Remote Document Vault Front end Go and Back end Node.js Compare performance of back end Go | Node.js (REST api)| WCF Stress Test the back end server View my project works : https://github.com/Dhappi/NodeWebService

References Node.js official document - http://nodejs.org/ Express official document - http://expressjs.com/ Go official document - https://golang.org/

Thank You www.bugzio.com