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.

Slides:



Advertisements
Similar presentations
Process management Information maintained by OS for process management  process context  process control block OS virtualization of CPU for each process.
Advertisements

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.
Jerry Neal. Agenda ➢ About Node ➢ Modules ➢ Node Architecture ➢ NPM ➢ FAQ ➢ Other Awesome Modules! get ready to node, this session is hands on!
Flash: An efficient and portable Web server Authors: Vivek S. Pai, Peter Druschel, Willy Zwaenepoel Presented at the Usenix Technical Conference, June.
Concurrency: Threads, Address Spaces, and Processes Sarah Diesburg Operating Systems COP 4610.
Why Concurrency? Allows multiple applications to run at the same time  Analogy: juggling.
SEDA: An Architecture for Well-Conditioned, Scalable Internet Services Matt Welsh, David Culler, and Eric Brewer Computer Science Division University of.
Precept 3 COS 461. Concurrency is Useful Multi Processor/Core Multiple Inputs Don’t wait on slow devices.
Apache Tomcat Server Typical html Request/Response cycle
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.
Serversideness Douglas Crockford Yahoo! Inc.. Server Side JavaScript 1996 Netscape LiveWire PHP-like. Fail. Now Node.js on V8. Event driven, turn based.
JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.
Node.js - What is Node.js? -
Concurrency: Threads, Address Spaces, and Processes Andy Wang Operating Systems COP 4610 / CGS 5765.
Operating Systems Lecture 2 Processes and Threads Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard. Zhiqing Liu School of.
Chapter 2 (PART 1) Light-Weight Process (Threads) Department of Computer Science Southern Illinois University Edwardsville Summer, 2004 Dr. Hiroshi Fujinoki.
INTRODUCTION TO JAVASCRIPT AND DOM Internet Engineering Spring 2012.
Concurrent Programming. Concurrency  Concurrency means for a program to have multiple paths of execution running at (almost) the same time. Examples:
Rapid Development of High Performance Servers Khaled ElMeleegy Alan Cox Willy Zwaenepoel.
1 Web Based Programming Section 8 James King 12 August 2003.
Background: Operating Systems Brad Karp UCL Computer Science CS GZ03 / M th November, 2008.
ASP.NET in Definition: 1.ASP.NET is a web application framework developed and marketed by Microsoft to allow programmers to build dynamic web sites,
Chat Room App Logan Linn Network Application Design Fall 2010.
Processes, Threads, and Process States. Programs and Processes  Program: an executable file (before/after compilation)  Process: an instance of a program.
Web Technologies Lecture 7 Synchronous vs. asynchronous.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
 Web pages originally static  Page is delivered exactly as stored on server  Same information displayed for all users, from all contexts  Dynamic.
1 OS Review Processes and Threads Chi Zhang
Threads versus Events CSE451 Andrew Whitaker. This Class Threads vs. events is an ongoing debate  So, neat-and-tidy answers aren’t necessarily available.
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.
Silberschatz, Galvin and Gagne  Operating System Concepts Chapter 4: Processes Process Concept Process Scheduling Types of shedulars Process.
Multithreading vs. Event Driven in Code Development of High Performance Servers.
Introduction to Node.js® Jitendra Kumar Patel Saturday, January 31, 2015.
NodeJS and MEAN cs6320.
Node.Js Server Side Javascript
Threads vs. Events SEDA – An Event Model 5204 – Operating Systems.
CSE 775 – Distributed Objects Submitted by: Arpit Kothari
Thread Fundamentals Header Advanced .NET Threading, Part 1
NodeJS and MEAN Prof. L. Grewe.
Chapter 3: Processes Source & Copyright: Operating System Concepts, Silberschatz, Galvin and Gagne.
Chapter 3: Processes.
3 Things Everyone Knows About Node JS That You Don't
Lecture 1 Runtime environments.
Node.js talking to PROGRESS
Node.Js Server Side Javascript
SPA Revolution with WebAssembly and Blazor Rainer Stropek | software
Concurrency: Threads, Address Spaces, and Processes
Capriccio – A Thread Model
Parallel Programming in Contemporary Programming Languages (Part 2)
MEAN stack L. Grewe.
Concurrency: Threads, Address Spaces, and Processes
CS 143A Quiz 1 Solution.
Chapter 3: Processes.
PROCESS MANAGEMENT Information maintained by OS for process management
CPU scheduling decisions may take place when a process:
Prof. Leonardo Mostarda University of Camerino
Chapter 3: Processes.
Concurrency: Processes CSE 333 Summer 2018
Why Events Are a Bad Idea (for high concurrency servers)
ASP.NET Imran Rashid CTO at ManiWeber Technologies.
Chapter 3: Processes Process Concept Process Scheduling
Introduction.
CS703 – Advanced Operating Systems
Light-Weight Process (Threads)
Concurrency: Threads, Address Spaces, and Processes
JavaScript.
Presentation transcript:

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 really fast  Runs over the command line  Designed for high concurrency ◦ Without threads or new processes  Never blocks, not even for I/O  Uses the CommonJS framework ◦ Making it a little closer to a real OO language

 Instead of threads Node uses an event loop with a stack  Alleviates overhead of context switching

 Request for “index.html” comes in  Stack unwinds and ev_loop goes to sleep  File loads from disk and is sent to the client

 Servers do nothing but I/O ◦ Scripts waiting on I/O requests degrades performance  To avoid blocking, Node makes use of the event driven nature of JS by attaching callbacks to I/O requests  Scripts waiting on I/O waste no space because they get popped off the stack when their non-I/O related code finishes executing

 Use of JS on both the client and server-side should remove need to “context switch” ◦ Client-side JS makes heavy use of the DOM, no access to files/databases ◦ Server-side JS deals mostly in files/databases, no DOM  JSDom project for Node works for simple tasks, but not much else

 Still in beta  Non-blocking nature takes some getting used to  Interesting API ◦ Can almost remake Dash!

   chromium-and-v8 chromium-and-v8  crankshaft-for-v8.html crankshaft-for-v8.html  Chrome-10-9-vs-Opera-11-vs-Firefox-11- Performance-Comparison shtml Chrome-10-9-vs-Opera-11-vs-Firefox-11- Performance-Comparison shtml