-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.html
More file actions
65 lines (61 loc) · 5.16 KB
/
index.html
File metadata and controls
65 lines (61 loc) · 5.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<html>
<link rel="stylesheet" type="text/css" href="newwebserver.css">
<head>
<title>MultiThread WebServer</title>
</head>
<center>
<body BGCOLOR="#000000" TEXT="#80c0c0" LINK="#ff8080" VLINK="#ff0000" ALINK="#a05050">
<div ALIGN="center">
<table BGCOLOR="#000080" BORDER=3 BORDERCOLOR="#0000ff"><tr>
<td><h1><font FACE="courier" SIZE=6><font SIZE=7>W</font>ELCOME TO Multithread WebServer!</font></h1></td>
</tr></table>
</div>
<br><br>
<p> Hi there! This Server is dedicated to multiple clients in one go ..! and indistinguishable from single-threaded servers from the client's point of view.</p>
<table BGCOLOR="#000080"><tr>
<td WIDTH=50> </td>
<td><font COLOR="#00ff00">Brought to you by:
<font FACE="'comic sans ms', fantasy" COLOR="#ffff00">"Under Operating System Lab Project : " </font>
</font></td>
</tr>
</table>
</center>
<div class="index">
<table BGCOLOR="#000080"><tr>
<td WIDTH=50>
<font FACE="'comic sans ms', fantasy" COLOR="#ffff00">CONTRIBUTORS: </font>
</td>
</tr>
</table>
<ol>
<li>Vishal Soni 2018IMT-106</li>
<li>Pathange Balaji Rao 2018IMT-064</li>
<li>Narendra Chaudhary 2018IMT-056</li>
<li>Utkarsh Gaur 2018IMT-102</li>
<li>Ajay Prakash Pipliwal 2018IMT-011</li>
<li>Gaddam Pranay 2018IMT-033</li>
</ol>
<p>A Process is basically a program, which is being executed by the processor with the process environment, which includes but not limited to Address Space, Page Table state, state of some processor registers and environment variables. A program here is just bytes, stored somewhere in memory.
</p>
<p>
We are going to implement version 1.0 of HTTP, as defined in RFC 1945, where separate HTTP requests are sent for each component of the Web page. The server will be able to handle multiple simultaneous service requests in parallel. This means that the Web server is multi-threaded. In the main thread, the server listens to a fixed port. When it receives a TCP connection request, it sets up a TCP connection through another port and services the request in a separate thread. To simplify this programming task, we will develop the code in two stages. In the first stage, you will write a multi-threaded server that simply displays the contents of the HTTP request message that it receives. After this program is running properly, you will add the code required to generate an appropriate response.
</p>
<p>
A Thread is an entity that exists within a process that represents a flow of instructions with its own Stack. So, many threads may exist within a process, sharing memory address space, but each having its own stack.
<p>
A single-core computer, we will assume there is only one instruction that can be executed at a time, although that may not be true So, generally, to run many threads at a time a technique called concurrency is used. That means that every quantile of processor time one instruction from a thread is executed and a thread is given some quantiles to work and do its job, after which its switched to another thread, which is also given some time to work and so on. This strategy is called preemption (each thread sort of pushes the other away from the processor and takes control over it for some time). Another strategy for context switching is called cooperative (when a programmer puts some marks in code, which say something like “I can now safely be switched, since I’ve finished all intermediate calculations”).
</p>
An OS entity called scheduler is in charge of all the things that regard context switching. Preemption is basically implemented by assigning each thread a priority label and increasing/decreasing it (in reality, it’s more complicated: the priority is added up with time spent in queue and so on)
<p>
Context switching. Process context is the state of some vital processor registers, stack state and page table, which is unique for each process. When scheduler chooses the next process to be executed, processor has to back up current registers state, load previously stored state for next process, switch Page Table for next process and load some additional service data. All these operations consume time, which is why, for example, you cannot have thousands of processes running super efficiently (but it depends on the number of processors and execution cores). Switching threads is similar to process switching, but here you just have to change stack.</p></div>
<center>
<ul style="list-style-type: none">
<li><a href="http://localhost:8080/WebServer.html">WebServer</a> </li> </br>
<li><a href="http://localhost:8080/Connect.html">Connection</a> </li> </br>
<li><a href="http://localhost:8080/HTTPRequest.html">HTTPRequest</a> </li> </br>
<li><a href="http://localhost:8080/HTTPResponse.html">HTTPResponse</a> </li> </br>
<ul>
<div><b> <font SIZE=6 COLOR="#ffffff">W</font>hen you are done looking through these masterpieces, I encourage you to visit again!! </b></div>
</center>
</body>
</html>