/
http://redwolf.cdf.toronto.edu:9999/csc309/servlet/HelloWorld http://redwolf.cdf.toronto.edu:9999/csc309/servlet/HelloWorld

http://redwolf.cdf.toronto.edu:9999/csc309/servlet/HelloWorld - PDF document

luanne-stotts
luanne-stotts . @luanne-stotts
Follow
376 views
Uploaded On 2016-08-14

http://redwolf.cdf.toronto.edu:9999/csc309/servlet/HelloWorld - PPT Presentation

shar ID: 445900

shar

Share:

Link:

Embed:

Download Presentation from below link

Download Pdf The PPT/PDF document "http://redwolf.cdf.toronto.edu:9999/csc3..." is the property of its rightful owner. Permission is granted to download and print the materials on this web site for personal, non-commercial use only, and to display it on your personal computer provided you do not modify the materials and that you retain all copyright notices contained in the materials. By downloading content from our website, you accept the terms of this agreement.


Presentation Transcript

http://redwolf.cdf.toronto.edu:9999/csc309/servlet/HelloWorldÐe.g.,http://localhost:9999/csc309/serlvet/HelloWorld¥Never hardcode machine names or port numbersin your applications -- use relative URLs instead!8Tomcat Directories¥bin: Includes startup and shutdown scripts¥conf: Configuration files including server.xml (on CDF,this is generated the first time you run bin/start.sh) andtomcat-users.xml¥logs: ServerÕs log files¥webapps: Applications¥work: ServerÕs temporary files. It is safe (and sometimeshelpful) to delete this directory after the server hasbeen shutdown9Other Issues about Tomcat¥Tomcat manager¥Debugging servlets¥Using Eclipse¥Installing Tomcat on your own computer¥Reference: AliÕs tutorial from the summer2008 term10Brief Preview of Scheduling¥Multiple threads ready to run¥Some mechanism for switching betweenthemÐContext switches¥Some policy for choosing the next threadto runÐThis policy may be pre-emptiveÐMeaning thread canÕt anticipate when it maybe forced to yield the CPUÐBy design, it is not easy to detect it hashappened (only the timing changes)11Synchronization¥Threads interact in a multiprogrammedsystemÐTo share resources (such as shared data)ÐTo coordinate their execution¥Arbitrary interleaving of thread executionscan have unexpected consequencesÐWe need a way to restrict the possibleinterleavings of executionsÐScheduling is invisible to the application¥Synchronization is the mechanism that givesus this control12Motivating Example¥Suppose we write functions to handlewithdrawals and deposits to bank account:Withdraw(acct, amt) { balance = get_balance(acct); balance = balance - amt; put_balance(acct,balance); return balance;}Deposit(acct, amt) { balance = get_balance(acct); balance = balance + amt; put_balance(acct,balance); return balance;}¥Now suppose you share this account withsomeone and the balance is $1000¥You each go to separate ATM machines - youwithdraw $100 and your S.O. deposits shar