Java Reference
In-Depth Information
CHAPTER 3
Threads
Back in the good old days of the Net, circa the early 1990s, we didn't have the Web and
HTTP and graphical browsers. Instead, we had Usenet news and FTP and command-
line interfaces, and we liked it that way! But as good as the good old days were, there
were some problems. For instance, when we were downloading kilobytes of free soft‐
ware from a popular FTP site over our 2,400 bps modems using Kermit, we would often
encounter error messages like this one:
% ftp eunl.java.sun.com
Connected to eunl.javasoft.com.
220 softwarenl FTP server (wu-2.4.2-academ[BETA- 16]+opie-2.32(1) 981105)
ready.
Name (eunl.java.sun.com:elharo): anonymous
530-
530- Server is busy. Please try again later or try one of our other
530- ftp servers at ftp.java.sun.com. Thank you.
530-
530 User anonymous access denied.
Login failed.
In fact, in the days when the Internet had only a few million users instead of a few billion,
we were far more likely to come across an overloaded and congested site than we are
today. The problem was that most FTP servers forked a new process for each connection
(i.e., 100 simultaneous users meant 100 additional processes to handle). Because pro‐
cesses are fairly heavyweight items, too many could rapidly bring a server to its knees.
The problem wasn't that the machines weren't powerful enough or the network fast
enough; it was that the FTP servers were poorly implemented. Many more simultaneous
users could be served if a new process wasn't needed for each connection.
Early web servers suffered from this problem as well, although the problem was masked
a little by the transitory nature of HTTP connections. Because web pages and their
embedded images tend to be small (at least compared to the software archives com‐
monly retrieved by FTP) and because web browsers “hang up” the connection after each
 
Search WWH ::




Custom Search