What is IIS in SharePoint 2013 and Http Request Life Cycle

Agenda

  • What is IIS?
  • Http Request Life Cycle

What is IIS (Internet Information Server)?
  • Website is a collection of web pages and other resources published on the World Wide Web using a computer connected to the internet and a web server software.
  • IIS is a windows component, a web server that accepts requests from client browsers and responds with the requested page(s).
  • Version of IIS in Windows 2012 Server = IIS 8.0

     IIS Manager: A tool to configure and manage IIS. To launch IIS Manager one of the   below methods can be used.
Control Panel –> Administrative Tools –> IIS Manager

(Or)

Run (Windows + R) –> Inetmgr.exe

Default Website: Default website is a website provided in IIS at the time of installation of IIS. The physical directory used by the default website of IIS is c:\inetpub\wwwroot and the port is 80

Http Request Life Cycle
  1. Http Server waits for the request to come on Socket (Port = 80)
  2. Web Browser submits a request for a given URL after creating a Socket in local process.
  3. Request is submitted to DNS server so that based on domain name IP address is fetched.
  4. Browser now submits the request to Http Server.
  5. Server accepts the request and shifts the client to another Socket that the socket on port 80 is released for receiving request from other clients.
  6. Now Browser and Server are connected to each other.
  7. Browser submits request as per HTTP protocol
  8. Server processes the request, renders the response and breaks the connection.
Hosting a Websites in IIS
  1. Go to IIS Manager
  2. Right click on Websites –> New –> Website
  3. Host Header = “www.DemoSite.com”
  4. Give Physical Directory: D:\DemoSite
  5. Go to DNS Server (Must have network adapter installed)
    • Right Click on Server Name –> New Zone –> Next, Next, Next, Next –> Zone name = demosite.com
    • Select demosite.com –> Right Click –> New Host
    • Name = www, IP address = 127.0.0.1
      Or
      Edit: c:\windows\system32\drivers\etc\hosts (this is alternative to DNS server)
      Note: Hosts is a file…Which can map name to IP Address
      127.0.0.1 www.DemoSite.com
      Note: The above address should be IP of server.
  6. In D:\DemoSite create and Html file (demo.html)
  7. Browser: http://www.DemoSite.com/Demo.html

Click here For Complete SharePoint 2013 Tutorial training

Multithreading in C Sharp Part1

Multithreading in C# – Threading Overview & Scheduling

Overview of Process and Threads

Process:

  • A process is a running instance of an application.
  • Every process has its own memory address space (execution environment) and it is in that all the data and
    the instructions of that process reside.
  • A process has a self-contained execution environment. A process generally has a complete, private set of
    basic run-time resources; in particular, each process has its own memory space

Thread:

  • The path of execution of instructions within a process is called a thread.
  • It has a starting point, execution sequence and terminating point.

A program with multiple simultaneous paths of execution is said to be multithreaded application.

Multithreading Multiprocessing/Multitasking
Multithreading is the ability of an operating system to execute the different parts of the program,
called threads, concurrently.
Multitasking is the ability of an operating system to accommodate more than one program in the memory at
the same time.
In multithreading all threads share same process address space [memory]. Processes do not share the memory
Threads can share variables since threads are in same process. External resources like file system or database must be used for communication between multiple processes and
each one runs under its unique process address space.
Inter thread communication is simple Inter process communication is complex
Less resources required to launch/run them since they are part of an already running process, hence they are
called as light weight tasks.
CPU has to spend more resources for launching a new process hence process is known as heavy weight.

Types of Scheduling

Preemptive: OS can un-schedule a thread even if it is not completed its task.

Non-Preemptive: OS cannot unschedule the thread. A Thread should either get unscheduled itself or it should
complete its task and release the processor.

  • Scheduling is done based on the priority of the thread. A thread with highest priority is executed in
    the processor. If multiple threads exist with same priority then a time slice is assigned to each thread.
  • In MS-Windows execution of the thread is based on: Preemptive Scheduling –> Priority –> Time slice
  • Also, in all versions of MS Windows, to avoid starvation low priority threads are also executed in the processor
    but the number of times they execute is very less.
  • Switching means that the processor stores the state of the outgoing thread (it does so by noting the current
    processor register values and the last instruction-set the thread was about to perform), restores the state of the
    incoming thread (again by restoring its processor register values and picking the last instruction-set where it had
    left itself) and then runs it.

Note: On a multi-processor system, the operating system can allocate individual threads to the separate
processors, which thus fastens the execution of the program. The efficiency of the threads also increases
significantly because the distribution of the threads on several processors is faster than sharing time-slices
on a single processor. It is particularly useful to have a multi-processor system for 3D modeling and image-processing.

Example of some Multithreading Applications:

  1. MS-Word – Auto Saving, Spell Checking, Printing while editing
  2. VS.NET – Intellisense, Auto Compilation.
  3. Browser – Downloading multiple files and browsing simultaneously.
  4. Media Player – Movie and Sound

For Complete C# Online training with material

Introducing Collections in C#

Introducing Collections

  • Closely related data can be handled more efficiently when grouped together into a collection. Instead of writing separate code to handle each individual object, you can use the same code to process all the elements of a collection.
  • A collection is a set of similarly typed objects that are grouped together. A collection is an object by itself, which
  • would manage other objects eg: ArrayList, HashTable, Stack, Queue, LinkedList, SortedList etc.
  • Collection classes are defined as part of the System.Collections and ystem.Collections.Generic namespace.
  • Most collection classes derive from the interfaces ICollection, IComparer, IEnumerable, IList, IDictionary, and IDictionaryEnumerator and their generic equivalents.
Benefits of Collections classes:
 
1. Built-in Sorting capabilities,
2. Most of them are automatically indexed to give best performance.
3. Memory management is handled automatically and Capacity of a collection is expanded as required.
4. Synchronization provides thread safety when accessing members of the collection.
5. Collections classes can generate wrappers that make the collection read-only or fixed-size.
6. Collections class can generate its own enumerator that makes it easy to iterate through the elements.
System.Collections classes can generally be categorized into three types:
  • Commonly used collections.
These are the common variations of data collections, such as hash tables, queues, stacks, dictionaries, and lists.
  • Bit collections.
These are collections whose elements are bit flags. They behave slightly differently from other collections.
  • Specialized collections.
These are collections with highly specific purposes, usually to handle a specific type of element, such as
NameValueCollection, StringDictionary and StringCollection
Closely related data can be handled more efficiently when grouped together into a collection. Instead of writing
separate code to handle each individual object, you can use the same code to process all the elements of a
collection.
i ) A collection is a set of similarly typed objects that are grouped together. A collection is an object by itself, which
would manage other objects eg: ArrayList, HashTable, Stack, Queue, LinkedList, SortedList etc.
ii ) Collection classes are defined as part of the System.Collections and System.Collections.Generic namespace.
iii ) Most collection classes derive from the interfaces ICollection, IComparer, IEnumerable, IList, IDictionary, and
IDictionaryEnumerator and their generic equivalents.
Benefits of Collections classes
1. Built-in Sorting capabilities,
2. Most of them are automatically indexed to give best performance.
3. Memory management is handled automatically and Capacity of a collection is expanded as required.
4. Synchronization provides thread safety when accessing members of the collection.
5. Collections classes can generate wrappers that make the collection read-only or fixed-size.
6. Collections class can generate its own enumerator that makes it easy to iterate through the elements.
System.Collections classes can generally be categorized into three types:
  • Commonly used collections.
These are the common variations of data collections, such as hash tables, queues, stacks, dictionaries, and
lists.
  • Bit collections.
These are collections whose elements are bit flags. They behave slightly differently from other collections.
  • Specialized collections.
These are collections with highly specific purposes, usually to handle a specific type of element, such as

NameValueCollection, StringDictionary and StringCollection

 

Understanding-and-Using-Commonly-Used-Collections
Learn Online C# Training for Beginners to Advanced