Corey Clark PhD Daniel Montgomery Web Dev Platform Cross Cross - - PowerPoint PPT Presentation

corey clark phd daniel montgomery web dev platform cross
SMART_READER_LITE
LIVE PREVIEW

Corey Clark PhD Daniel Montgomery Web Dev Platform Cross Cross - - PowerPoint PPT Presentation

Corey Clark PhD Daniel Montgomery Web Dev Platform Cross Cross Platform Browser HTML5 Web Web WebGL Socket Worker Optimized Parallel Hardware Communication Acceleration Processing Channel Web Workers JaHOVA OS Internal APIs


slide-1
SLIDE 1

Corey Clark PhD Daniel Montgomery

slide-2
SLIDE 2

Web Dev Platform Cross Platform Cross Browser

HTML5

WebGL Web Socket Web Worker

Hardware Acceleration Optimized Communication Channel Parallel

Processing

slide-3
SLIDE 3

JaHOVA OS Kernel Internal APIs Threading Network Graphics Web Workers Web Sockets WebGL

slide-4
SLIDE 4

Web Workers and Multithreading

§

Parallel Execution

§

Communicates through Message

§

Executes in Isolated Thread

  • No Access To
  • DOM, Window
  • Document, Parent
  • No Shared Memory
  • But You Do Have…
  • XHR / WebSockets
  • Navigator,Location
  • setTimeout/setInterval
  • App Cache, importScript
slide-5
SLIDE 5
slide-6
SLIDE 6

Time to Create First Worker

  • Varies depending on Worker Size
  • Can take a second to start
  • Initialize at beginning with a startup routine
slide-7
SLIDE 7
slide-8
SLIDE 8
slide-9
SLIDE 9
slide-10
SLIDE 10

Web Worker Variations

  • Inline vs. External
  • BlobBuilder
  • Inline only supported by FF and Chrome
  • No difference in performance
  • Dynamic
  • Method determined at run time from JSON

string

  • Altered and changed by user at run time
slide-11
SLIDE 11

Nested Shared

Worker Nested Worker Main Thread Nested Worker Nested Worker Window Window iframe Shared Worker

slide-12
SLIDE 12

Platform Support

  • Chrome/Firefox/Safari
  • Chrome/Safari supports Shared Only
  • Firefox supports Nested Only
  • Android – (via Firefox and Opera Browser)
  • iOS
  • IE 10
slide-13
SLIDE 13

Command Module Internal APIs Thread Thread Core Instruction Module Thread Thread / iframe Thread / iframe … Thread Controller Thread Thread Pool Thread Manager Shared Memory

slide-14
SLIDE 14
slide-15
SLIDE 15

What is WebGL?

OpengGL ES 2.0

slide-16
SLIDE 16

WebGL

The Basics Sample API/Libraries

  • JavaScript Wrapper

for OpenGL ES 2.0

  • Programmable

Graphics Pipeline (GLSL)

  • Hardware

Acceleration

  • SpiderGL
  • Copperlicht
  • CubicVR
  • Gladius
slide-17
SLIDE 17
slide-18
SLIDE 18

WebGL Hardware Test

Verts Polys Draw FPS CPU RAM Video OS 858,750 485,292 654 30 2.2GHz Intel i7 Quad Core 4GB AMD Radeon 6750M 1GB OSX 634,179 353,386 483 30 2.53GH z Intel Core 2 Duo 4GB NVIDIA 9800+ 1GB Windows 7 590,898 333,924 450 33.33 2.53GH z Intel Core 2 Duo 8GB NVIDIA GeForce 9600M GT 512MB OSX

Chrome

slide-19
SLIDE 19

Browser vs Browser

Browser Verts Polys Draw Calls Chrome 590,898 333,924 450 Aurora 426,773 241,174 325 WebKit Nightly 393,948 222,624 300 Safari 295,473 166,974 225 Firefox 262,648 148,424 200

slide-20
SLIDE 20

WebGL Tid Bits

Tips Up and coming

  • DebugContex
  • WebGL Inspector
  • requestAnimFrame
  • BMP Support
  • No IE Support with out

plugins and Hackery

  • WebGL Running in

Web Worker

  • Swapping Memory

Buffer rather than copy

slide-21
SLIDE 21

+ +

slide-22
SLIDE 22

Web Sockets

  • Full Duplex Communication
  • No HTTP overhead
  • Has Secure Transport Protocol
  • Cross Origin Communication
  • Very Simple Client Side API
  • Socket.onmessage = function(){}
  • Socket.onopen = function(){}
  • Socket.open(), Socket.send(), Socket.close()
slide-23
SLIDE 23

Nitty Gritty

  • 2 Bytes Overhead Per Message
  • XHR ~871 Bytes
  • Constant Connection
  • No need to re-establish connection (COMET)
  • Connecting to Non Browser Applications

(via Proxy/Server)

  • Byte Arrays
  • Bit Shifting
slide-24
SLIDE 24

Daniel Montgomery

slide-25
SLIDE 25
  • Standard HTTP Request/

Response model performs poorly for high number of users

  • Server Needs
  • Thread or Non

Blocking IO Design

  • High concurrency at

Low Performance cost

  • Existing Servers
  • Node.js
  • Jetty (Java)
  • Ruby (Event

Machine)

  • Python (Twisted)
slide-26
SLIDE 26
  • Google V8 Engine
  • JavaScript
  • Event Driven
  • Event Loop with Callbacks
  • Non-Blocking
  • Native C++ Bindings
  • Fast!!

FEATURES

  • WebSocket Server
  • Socket.IO
  • Kaazing Gateway
  • TCP Server
  • File Server
  • MySQL, MongoDB,

NoSQL

Modules (NPM)

slide-27
SLIDE 27
  • Well Kept After
  • Documented
  • Quick Response
  • Use existing Git
  • npm dependencies
  • Fast!
  • (“Hello World!” in 1 minute)

Free!!!

FEATURES

slide-28
SLIDE 28

Other hosting options…

http://no.de eSession ("Omega"["gunner" , "pilot"]); http://heroku.com http://nodejitsu.com http://cloudno.de

slide-29
SLIDE 29

JaHOVA OS Server Module

  • Connect to Multiple Applications on

same server

  • Remote Stream Functions
  • User Creation on the fly
  • Support for Multiple Connection Types
  • TCP
  • WebSockets
  • Socket.IO and Express node.js modules
slide-30
SLIDE 30

JOSSM: Breakdown

  • Multiple Sessions
  • Multiple Session Types
  • Defined in a single line!
  • Streamed Sessions, Modules, and

Functions

  • Easily add and connect users to

multiple sessions

handler.createSession("Omega", "", ["gunner", "pilot"]);

slide-31
SLIDE 31

JOSSM: Session Breakdown

  • Session Specific Properties
  • On Events
  • Open
  • Close
  • Message
  • Error
  • Multiple Modules
  • Remote Module Requests
slide-32
SLIDE 32

Engine Architecture

  • Dynamic Nested/Shared Web Worker
  • Thread Controller
  • Shared Memory Pool
  • Custom Event Management System
  • Available Engines
  • Akihabara (2D)
  • Effect Game (2D)
  • Isogenic Engine
  • Johmoho
slide-33
SLIDE 33

3rd Party Extensions

Application

JaHOVA OS Kernel Internal APIs

Resource and Schedule Manager Module

Instruction Module

Command Module

Threading Network DOM Graphics …

slide-34
SLIDE 34

Resource and Schedule Manager Module Event Manager Event Manager Interface

Event Object

Event Event

Event Object

Event Event

… …

Subscriber Callback Subscriber Callback Subscriber Callback Subscriber Callback Core Manager Command Module

slide-35
SLIDE 35

Resource and Schedule Manager Module

Instruction Module Router Route

Resource Instruction Q Resource Instruction Q Resource Instruction Q

Add Request

… … Event Manager

Core Manager Command Module

Resource Dispatcher Resource Dispatcher Resource Dispatcher

slide-36
SLIDE 36

Engine Demonstration

  • WebGL, WebSockets, Web Workers
  • HTML5 Audio
  • Thread Controller
  • Networking and Physics
  • Node.js
  • JaHOVA OS Server Module
  • WebSocket - SocketIO
  • Developed in under a week
slide-37
SLIDE 37
slide-38
SLIDE 38

Final Thoughts

  • Initialize Threads at Startup
  • Initialization Timing
  • Serialize for dependencies and registration
  • Careful with Debuggers and Web Workers
  • See more at
  • http://jahovaos.com : Descriptions and Blog
  • http://demo.jahovaos.com : Code
  • Expo Floor 2-4 on Wed @ DeVry Booth