www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

index.html (3980B)


      1 <!DOCTYPE html>
      2 <html>
      3 	<head>
      4 		<title>banna - ramblings</title>
      5 		<meta name="viewport" content="width=device-width, initial-scale=1">
      6 		<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      7 		<link rel="stylesheet" href="/styles/style.css" />
      8 		<link rel="stylesheet" href="/styles/look.css" />
      9 		<link rel="stylesheet" href="/styles/codetheme.css" />
     10 		<script src="/scripts/highlight.js"></script>
     11 		<script>hljs.initHighlightingOnLoad();</script>
     12 	</head>
     13 
     14 	<body>
     15 		<div id="sidebar">
     16 			<div id="logo">
     17 				<a href="/">
     18 					<img src="/banna.png" alt="banna.tech" height="45" width="201" />
     19 				</a>
     20 			</div>
     21 			<div id="nav">
     22 				<a class="current" href="/post">blog</a>
     23 				<a class="" href="/things">things</a>
     24 				<a class="" href="/about">about</a>
     25 			</div>
     26 		</div>
     27 
     28 		<div id="wrapper">
     29 			<div id="content">
     30 <div class="post">
     31     <a href="/post/thoughts_on_threading" class="link"><h1 class="header">Thoughts on Threading</h1></a>
     32     <span class="date">Posted on February, 02 2016</span>
     33     <div class="content">
     34 <p><img src="//i.banna.tech/170blog.jpg" style="box-shadow:0px 0px 5px black"></img></p>
     35 <p>'Threading' invokes a certain response in a programmers mind. To the layperson, 'Threading' (or "multithreading") implies that, given a running program, that program can run two or more pieces of code at the same time.</p>
     36 <p>Multi-tasking and multi-processing dates back to the early 1970's and early 1980's, when computing required that all resources to be used in the most efficient way possible. The large, slow, and expensive computers at the time only existed in established institutions, where researchers would run computations on what were known as <a href="https://en.wikipedia.org/wiki/Time-sharing">time-sharing</a> systems. Time-sharing systems took a large 'mainframe' computer, and tied many users via teletype terminals where users would interact with the mainframe. It is this notion of multi-user systems that spawned the famous Unix systems, and the artifacts are found in the core design of any Unix-like system today. Due to these multi-user systems, time sharing algorithms have allowed the modern-day data centers to be an epicenter of distributed computations. Online services like Google, Amazon, Microsoft, and Facebook all take advantage of the idea of multi-user time-sharing systems to handle billions of requests without delay.</p>
     37 <p>In the domain of individual applications, multi-threading arose when CPU's began incorporating multiple cores to simultaneously run two processes at the same time. In implementation, there are two types of threads that integrate with the operating system. One of the objectives a sane operating system must tackle is handling various processes that run on a given system. Under a process, the <a href="https://en.wikipedia.org/wiki/Kernel_(operating_system)">kernel</a> organizes what are known as 'Kernel threads', which are running programs that share resources with other kernel threads which share the same process. For any process, there is at least one kernel thread. Scheduling of kernel threads are, by definition, handled by the operating system. Due to this, a program that implements kernel threads cannot control the behavior and scheduling of the threads it creates, which may not be fine-tuned for the applications needs. Besides kernel threads, there is another type of thread implementation that handles thread scheduling in <a href="https://en.wikipedia.org/wiki/User_space">user-space</a>, as compared to kernel threads which are handled in kernel space. Userspace threading implementations take advantage of kernel threads to distribute jobs across available processors and implement a preferred scheduling scheme for the application at hand.</p>
     38 <p>Modern computing wouldn't be where it is without the concept of juggling processes and threads over a shared piece of computing equipment.</p>
     39     </div>
     40 </div>
     41 
     42 
     43 			</div>
     44 		</div>
     45 	</body>
     46 </html>