---
created_at: '2017-03-22T12:25:12.000Z'
title: How long does it take to make a context switch? (2010)
url: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html
author: majke
points: 87
story_text: 
comment_text: 
num_comments: 72
story_id: 
story_title: 
story_url: 
parent_id: 
created_at_i: 1490185512
_tags:
- story
- author_majke
- story_13930305
objectID: '13930305'

---
[Source](http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html "Permalink to Tsuna's blog: How long does it take to make a context switch?")

# Tsuna's blog: How long does it take to make a context switch?

#  [ Tsuna's blog ][1]

In code we trust.

## Sunday, November 14, 2010

###  [How long does it take to make a context switch?][2]

That's a interesting question I'm willing to spend some of my time on. Someone at StumbleUpon emitted the hypothesis that with all the improvements in the [Nehalem architecture][3] (marketed as Intel i7), context switching would be much faster. How would you devise a test to empirically find an answer to this question? How expensive are context switches anyway? (tl;dr answer: **very expensive**)  

##  The lineup

_April 21, 2011 update: I added an "extreme" Nehalem and a low-voltage Westmere._  
_April 1, 2013 update: Added an Intel Sandy Bridge E5-2620._  
I've put 4 different generations of CPUs to test:  

* A dual [Intel 5150][4] (Woodcrest, based on the [old "Core" architecture][5], 2.67GHz). The 5150 is a dual-core, and so in total the machine has 4 cores available. Kernel: 2.6.28-19-server x86_64.
* A dual [Intel E5440][6] (Harpertown, based on the [Penrynn architecture][7], 2.83GHz). The E5440 is a quad-core so the machine has a total of 8 cores. Kernel: 2.6.24-26-server x86_64.
* A dual [Intel E5520][8] (Gainestown, based on the [Nehalem architecture][3], aka i7, 2.27GHz). The E5520 is a quad-core, and has HyperThreading enabled, so the machine has a total of 8 cores or 16 "hardware threads". Kernel: 2.6.28-18-generic x86_64.
* A dual [Intel X5550][8] (Gainestown, based on the [Nehalem architecture][3], aka i7, 2.67GHz). The X5550 is a quad-core, and has HyperThreading enabled, so the machine has a total of 8 cores or 16 "hardware threads". Note: the X5550 is in the "server" product line. This CPU is 3x more expensive than the previous one. Kernel: 2.6.28-15-server x86_64.
* A dual [Intel L5630][9] (Gulftown, based on the [Westmere architecture][10], aka i7, 2.13GHz). The L5630 is a quad-core, and has HyperThreading enabled, so the machine has a total of 8 cores or 16 "hardware threads". Note: the L5630 is a "low-voltage" CPU. At equal price, this CPU is in theory 16% less powerful than a non-low-voltage CPU. Kernel: 2.6.32-29-server x86_64.
* A dual [Intel E5-2620][11] (Sandy Bridge-EP, based on the [Sandy Bridge architecture][12], aka E5, 2Ghz). The E5-2620 is a hexa-core, has HyperThreading, so the machine has a total of 12 cores, or 24 "hardware threads". Kernel: 3.4.24 x86_64.
As far as I can say, all CPUs are set to a constant clock rate (no Turbo Boost or anything fancy). All the Linux kernels are those built and distributed by Ubuntu.  

##  First idea: with syscalls (fail)

My first idea was to make a cheap system call many times in a row, time how long it took, and compute the average time spent per syscall. The cheapest system call on Linux these days seems to be [`gettid`][13]. Turns out, this was a naive approach since system calls don't actually cause a full context switch anymore nowadays, the kernel can get away with a "mode switch" (go from user mode to kernel mode, then back to user mode). That's why when I ran my first test program, `vmstat` wouldn't show a noticeable increase in number of context switches. But this test is interesting too, although it's not what I wanted originally.  
  
Source code: [timesyscall.c][14] Results:  

* Intel 5150: 105ns/syscall
* Intel E5440: 87ns/syscall
* Intel E5520: 58ns/syscall
* Intel X5550: 52ns/syscall
* Intel L5630: 58ns/syscall
* Intel E5-2620: 67ns/syscall
Now that's nice, more expensive CPUs perform noticeably better (note however the slight increase in cost on Sandy Bridge). But that's not really what we wanted to know. So to test the cost of a context switch, we need to force the kernel to de-schedule the current process and schedule another one instead. And to benchmark the CPU, we need to get the kernel to do nothing but this in a tight loop. How would you do this?  

##  Second idea: with `futex`

The way I did it was to abuse [`futex`][15] ([RTFM][16]). `futex` is the low level Linux-specific primitive used by most threading libraries to implement blocking operations such as waiting on a contended mutexes, semaphores that run out of permits, condition variables and friends. If you would like to know more, go read [Futexes Are Tricky][17] by Ulrich Drepper. Anyways, with a futex, it's easy to suspend and resume processes. What my test does is that it forks off a child process, and the parent and the child take turn waiting on the futex. When the parent waits, the child wakes it up and goes on to wait on the futex, until the parent wakes it and goes on to wait again. Some kind of a ping-pong "I wake you up, you wake me up...".  
  
Source code: [timectxsw.c][18] Results:  

* Intel 5150: ~4300ns/context switch
* Intel E5440: ~3600ns/context switch
* Intel E5520: ~4500ns/context switch
* Intel X5550: ~3000ns/context switch
* Intel L5630: ~3000ns/context switch
* Intel E5-2620: ~3000ns/context switch
Note: those results include the overhead of the `futex` system calls.  
  
Now you must take those results with a grain of salt. The micro-benchmark does _nothing_ but context switching. In practice context switching is expensive because it screws up the CPU caches (L1, L2, L3 if you have one, and the [TLB][19] – don't forget the TLB!).  

##  CPU affinity

Things are harder to predict in an SMP environment, because the performance can vary wildly depending on whether a task is migrated from one core to another (especially if the migration is across physical CPUs). I ran the benchmarks again but this time I pinned the processes/threads on a single core (or "hardware thread"). The performance speedup is dramatic.  
  
Source code: [cpubench.sh][20] Results:  

* Intel 5150: ~1900ns/process context switch, ~1700ns/thread context switch
* Intel E5440: ~1300ns/process context switch, ~1100ns/thread context switch
* Intel E5520: ~1400ns/process context switch, ~1300ns/thread context switch
* Intel X5550: ~1300ns/process context switch, ~1100ns/thread context switch
* Intel L5630: ~1600ns/process context switch, ~1400ns/thread context switch
* Intel E5-2620: ~1600ns/process context switch, ~1300ns/thread context siwtch
Performance boost: 5150: 66%, E5440: 65-70%, E5520: 50-54%, X5550: 55%, L5630: 45%, E5-2620: 45%.  
  
The performance gap between thread switches and process switches seems to increase with newer CPU generations (5150: 7-8%, E5440: 5-15%, E5520: 11-20%, X5550: 15%, L5630: 13%, E5-2620: 19%). Overall the penalty of switching from one task to another remains very high. Bear in mind that those artificial tests do absolutely zero computation, so they probably have 100% cache hit in L1d and L1i. In the real world, switching between two tasks (threads or processes) typically incurs significantly higher penalties due to cache pollution. But we'll get back to this later.  

##  Threads vs. processes

After producing the numbers above, I quickly criticized Java applications, because it's fairly common to create shitloads of threads in Java, and the cost of context switching becomes high in such applications. Someone retorted that, yes, Java uses lots of threads but threads have become significantly faster and cheaper with the [NPTL][21] in Linux 2.6. They said that normally there's no need to do a TLB flush when switching between two threads of the same process. That's true, you can go check the source code of the Linux kernel ([`switch_mm` in `mmu_context.h`][22]):  

    
    
    static inline void switch_mm(struct mm_struct *prev, struct mm_struct *next,
                                 struct task_struct *tsk)
    {
           unsigned cpu = smp_processor_id();
    
           if (likely(prev != next)) {
                   [_...]_
                   load_cr3(next->pgd);
           } else {
                   [_don't typically reload cr3]_
           }
    }

In this code, the kernel expects to be switching between tasks that have different memory structures, in which cases it updates [CR3][23], the register that holds a pointer to the [page table][24]. Writing to CR3 automatically causes a TLB flush on x86.  
  
In practice though, with the default kernel scheduler and a busy server-type workload, it's fairly infrequent to go through the code path that skips the call to `load_cr3`. Plus, different threads tend to have different working sets, so even if you skip this step, you still end up polluting the L1/L2/L3/TLB caches. I re-ran the benchmark above with 2 threads instead of 2 processes (source: [timetctxsw.c][25]) but the results aren't significantly different (this varies a lot depending on scheduling and luck, but on average on many runs it's typically only 100ns faster to switch between threads if you don't set a custom CPU affinity).  

##  Indirect costs in context switches: cache pollution

The results above are in line with a paper published a bunch of guys from University of Rochester: [Quantifying The Cost of Context Switch][26]. On an unspecified Intel Xeon (the paper was written in 2007, so the CPU was probably not _too_ old), they end up with an average time of 3800ns. They use another method I thought of, which involves writing / reading 1 byte to / from a pipe to block / unblock a couple of processes. I thought that (ab)using futex would be better since futex is essentially exposing some scheduling interface to userland.  
  
The paper goes on to explain the indirect costs involved in context switching, which are due to cache interference. Beyond a certain working set size (about half the size of the L2 cache in their benchmarks), the cost of context switching increases dramatically (by 2 orders of magnitude).  
  
I think this is a more realistic expectation. Not sharing data between threads leads to optimal performance, but it also means that every thread has its own working set and that when a thread is migrated from one core to another (or worse, across physical CPUs), the cache pollution is going to be costly. Unfortunately, when an application has many more active threads than hardware threads, this is happening all the time. That's why not creating more active threads than there are hardware threads available is so important, because in this case it's easier for the Linux scheduler to keep re-scheduling the same threads on the core they last used ("weak affinity").  
  
Having said that, these days, our CPUs have much larger caches, and can even have an L3 cache.  

* 5150: L1i & L1d = 32K each, L2 = 4M
* E5440: L1i & L1d = 32K each, L2 = 6M
* E5520: L1i & L1d = 32K each, L2 = 256K/core, L3 = 8M (same for the X5550)
* L5630: L1i & L1d = 32K each, L2 = 256K/core, L3 = 12M
* E5-2620: L1i & L1d = 64K each, L2 = 256K/core, L3 = 15M
Note that in the case of the E5520/X5550/L5630 (the ones marketed as "i7") as well as the Sandy Bridge E5-2520, the L2 cache is tiny but there's one L2 cache per core (with HT enabled, this gives us 128K per hardware thread). The L3 cache is shared for all cores that are on each physical CPU.  
  
Having more cores is great, but it also increases the chance that your task be rescheduled onto a different core. The cores have to "migrate" cache lines around, which is expensive. I recommend reading [What Every Programmer Should Know About Main Memory][27] by Ulrich Drepper (yes, him again!) to understand more about how this works and the performance penalties involved.  
  
So how does the cost of context switching increase with the size of the working set? This time we'll use another micro-benchmark, [timectxswws.c][28] that takes in argument the number of pages to use as a working set. This benchmark is exactly the same as the one used earlier to test the cost of context switching between two processes except that now each process does a `memset` on the working set, which is _shared_ across both processes. Before starting, the benchmark times how long it takes to write over all the pages in the working set size requested. This time is then discounted from the total time taken by the test. This attempts to estimate the _overhead_ of overwriting pages across context switches.  
  
Here are the results for the 5150:![][29]As we can see, the time needed to write a 4K page more than doubles once our working set is bigger than what we can fit in the L1d (32K). The time per context switch keeps going up and up as the working set size increases, but beyond a certain point the benchmark becomes dominated by memory accesses and is no longer actually testing the overhead of a context switch, it's simply testing the performance of the memory subsystem.  
  
Same test, but this time with CPU affinity (both processes pinned on the same core):![][30]Oh wow, watch this! It's an _order of magnitude_ faster when pinning both processes on the same core! Because the working set is shared, the working set fits entirely in the 4M L2 cache and cache lines simply need to be transfered from L2 to L1d, instead of being transfered from core to core (potentially across 2 physical CPUs, which is far more expensive than within the same CPU).  
  
Now the results for the i7 processor:![][31]Note that this time I covered larger working set sizes, hence the log scale on the X axis.  
  
So yes, context switching on i7 is faster, but only for so long. Real applications (especially Java applications) tend to have large working sets so typically pay the highest price when undergoing a context switch. Other observations about the Nehalem architecture used in the i7:  

* Going from L1 to L2 is almost unnoticeable. It takes about 130ns to write a page with a working set that fits in L1d (32K) and only 180ns when it fits in L2 (256K). In this respect, the L2 on Nehalem is more of a "L1.5", since its latency is simply not comparable to that of the L2 of previous CPU generations.
* As soon as the working set increases beyond 1024K, the time needed to write a page jumps to 750ns. My theory here is that 1024K = 256 pages = half of the TLB of the core, which is shared by the two HyperThreads. Because now both HyperThreads are fighting for TLB entries, the CPU core is constantly doing page table lookups.
Speaking of TLB, the Nehalem has an interesting architecture. Each core has a 64 entry "L1d TLB" (there's no "L1i TLB") and a unified 512 entry "L2TLB". Both are dynamically allocated between both HyperThreads.  

##  Virtualization

I was wondering how much overhead there is when using virtualization. I repeated the benchmarks for the dual E5440, once in a normal Linux install, once while running the same install inside VMware ESX Server. The result is that, on average, it's 2.5x to 3x more expensive to do a context switch when using virtualization. My _guess_ is that this is due to the fact that the guest OS can't update the page table itself, so when it attempts to change it, the hypervisor intervenes, which causes an extra 2 context switches (one to get inside the hypervisor, one to get out, back to the guest OS).  
  
This probably explains why Intel added the EPT ([Extended Page Table][32]) on the Nehalem, since it enables the guest OS to modify its own page table without help of the hypervisor, and the CPU is able to do the end-to-end memory address translation on its own, entirely in hardware (virtual address to "guest-physical" address to physical address).  

##  Parting words

Context switching is expensive. My rule of thumb is that it'll cost you about 30µs of CPU overhead. This seems to be a good worst-case approximation. Applications that create too many threads that are constantly fighting for CPU time (such as Apache's HTTPd or many Java applications) can waste considerable amounts of CPU cycles just to switch back and forth between different threads. I think the sweet spot for optimal CPU use is to have the same number of worker threads as there are hardware threads, and write code in an asynchronous / non-blocking fashion. Asynchronous code tends to be CPU bound, because anything that would block is simply deferred to later, until the blocking operation completes. This means that threads in asynchronous / non-blocking applications are much more likely to use their full time quantum before the kernel scheduler preempts them. And if there's the same number of runnable threads as there are hardware threads, the kernel is very likely to reschedule threads on the same core, which _significantly_ helps performance.  
  
Another hidden cost that severely impacts server-type workloads is that after being switched out, even if your process becomes runnable, it'll have to wait in the kernel's run queue until a CPU core is available for it. Linux kernels are often compiled with `HZ=100`, which entails that processes are given time slices of 10ms. If your thread has been switched out but becomes runnable almost immediately, and there are 2 other threads before it in the run queue waiting for CPU time, your thread may have to wait up to 20ms in the worst scenario to get CPU time. So depending on the average length of the run queue (which is reflected in load average), and how long your threads typically run before getting switched out again, this can considerably impact performance.  
  
It is illusory to imagine that NPTL or the Nehalem architecture made context switching cheaper in real-world server-type workloads. Default Linux kernels don't do a good job at keeping CPU affinity, even on idle machines. You must explore alternative schedulers or use [`taskset`][33] or [`cpuset`][34] to control affinity yourself. If you're running multiple different CPU-intensive applications on the same server, manually partitioning cores across applications can help you achieve very significant performance gains. 

Posted by Benoit Sigoure at [11/14/2010 08:53:00 PM][35] [ ![][36] ][37]

[Email This][38][BlogThis!][39][Share to Twitter][40][Share to Facebook][41][Share to Pinterest][42]

Labels: [Linux][43], [performance][44], [profiling][45]

#### 30 comments:

![][46][ ][47]

[Adrian Cockcroft][47] said... 
: 

Context switch timing benchmarks have been around for a long time, why not run something like lmbench?  
http://lmbench.sourceforge.net/cgi-bin/man?keyword=lmbench&section=8 

:  [ November 27, 2010 at 11:43 AM ][48] [ ![][49] ][50]

![][51][ ][52]

[techinterview][52] said... 
: 

Thanks! I've always wondered what the performance hit would be in a virtual machine environment. 

:  [ November 27, 2010 at 2:20 PM ][53] [ ![][49] ][54]

![][55]

Anonymous said... 
: 

You don't appear to mention if you're testing on a x86 or x86_64 system (as those CPUs can run both). Syscalls are _much_ faster on x86_64. 

:  [ November 27, 2010 at 2:43 PM ][56] [ ![][49] ][57]

![][55]

Anonymous said... 
: 

Benoit,  
  
I sent you an email to the address listed in your bio. Let me know if you're interested! Thanks,  
  
Adam 

:  [ November 27, 2010 at 3:01 PM ][58] [ ![][49] ][59]

![][55]

Anonymous said... 
: 

very interesting blog post, thanks 

:  [ November 27, 2010 at 3:47 PM ][60] [ ![][49] ][61]

![][55]

Anonymous said... 
: 

Leaving on HyperThreading does not give a good indication. HyperThreading does not have a true doubling of hardware threads. There is a probability of contention of the same rare resources. This test should be re-run with HyperThreading disabled to get a look at true numbers. HyperThreading works best when your issue is total throughput, where lazy workloads can better make use of idle areas of the CPU. In a contentious environment with latency sensitivity, HT works against predictability and overall performance when measured as lower latency. 

:  [ November 27, 2010 at 6:27 PM ][62] [ ![][49] ][63]

![][55]

Anonymous said... 
: 

An async server still has context switches, and I mean from a conceptual angle, not a processor angle. A select server still has to change which data structures it is working on. During those events you are switching the context and L2 will need to be switched out.   
  
And don't forget the other cost, which would be code cleanliness and complexity. 

:  [ November 27, 2010 at 7:30 PM ][64] [ ![][49] ][65]

![][66][ ][67]

[James Aguilar][67] said... 
: 

Your conclusion about writing servers in async style versus sync style is not justified by the data. You said yourself that the problem with a context switch is that it trashes your cache. What do you think happens when you submit one async operation and the thread switches to working on another one? Because all the data for the second operation is not in the cache, it has to be faulted in. The effect is the same as the effect of switching to another thread. If data for the second op does not have to be faulted in (i.e. it is already in the cache), then the same would hold for thread-switching and the switch would be inexpensive.  
  
I can buy that you would not want to have many more CPU-bound threads than hardware threads, but even that conclusion is dubious. If the cost of a context switch is 30 microseconds and the Linux kernel has 1000 time-slices per second, then the most you could be spending on context switches is 30 ms per second, or about three percent of the computer's power. Maybe through other mechanisms the situation is actually worse than this, but without experimentation it will not be easy to be sure. 

:  [ November 28, 2010 at 11:03 AM ][68] [ ![][49] ][69]

![][70][ ][71]

[tsuna][71] said... 
: 

@Adrian Cockcroft: I didn't use lmbench because I was wondering how to write such a benchmark in the first place, and you always learn more by building things yourself than by using something already existing. My little benchmarks aren't supposed to be alternatives to lmbench, I simply provided the source code so others could unambiguously see how I did the benchmarks and reproduce them. 

:  [ November 29, 2010 at 5:44 PM ][72] [ ![][49] ][73]

![][70][ ][71]

[tsuna][71] said... 
: 

@Anonymous 1: All the tests happened in an x86_64 environment. I will update the post to reflect this. 

:  [ November 29, 2010 at 5:44 PM ][74] [ ![][49] ][75]

![][70][ ][71]

[tsuna][71] said... 
: 

@Anonymous 4: I left HyperThreading on because that's what we use on our servers at StumbleUpon (for a variety of reasons). The only "true numbers" are the ones that actually matter for your environment. I know how HT works and the limitations it has, but this isn't relevant to this post. 

:  [ November 29, 2010 at 5:44 PM ][76] [ ![][49] ][77]

![][70][ ][71]

[tsuna][71] said... 
: 

@Anonymous 5 and James Aguilar: async servers are more likely to perform better than non-async servers. YMWV depending on the type of server we're talking about. At least not doing context switches saves TLB flushes. If you design and implement your multi-threaded server appropriately, you can maximize the performance by using dedicated threads per task type and CPU affinity in order to keep the high cache hit rate that boosts performance so much. Yes it's more work to implement servers this way, but it's the price to pay for the best performance. I changed a server application at StumbleUpon to be fully async non-blocking and I gained from 40% to a full order of magnitude performance boost, depending on the workload. 

:  [ November 29, 2010 at 5:44 PM ][78] [ ![][49] ][79]

![][70][ ][71]

[tsuna][71] said... 
: 

@James Aguilar: I'm not sure to follow your calculation that leads you to the conclusion that you can't spend more than 3% of your time context switching. I have a MySQL database server running on a dual E7220 = 4 actual cores, it's doing 25k context switches per second, meaning it's doing on average 25000/4=6250 switches per core per second, if each switch takes 30µs, each core is spending 187500µs = 187ms per second doing context switches, which translates in 18.75% of the CPU cycles being wasted switching. In practice though, I'm guessing that this DB doesn't get the full 30µs penalty thanks to shared working set and saved TLB flushes (most of the active threads are part of the same process, so they share the same address space), so we can see 18.75% as the theoretical upper bound of the percentage of CPU cycles wasted to context switching. 

:  [ November 29, 2010 at 5:44 PM ][80] [ ![][49] ][81]

![][82][ ![][83]][84]

[pankaj@tux][84] said... 
: 

What should take more time a context switch or a user-kernel mode switch? 

:  [ February 14, 2011 at 9:28 PM ][85] [ ![][49] ][86]

![][70][ ][71]

[tsuna][71] said... 
: 

pankaj@tux: this article shows that context switching takes a lot more time than just a simple user-kernel switch (aka mode switch). System calls only do a mode switch. 

:  [ February 14, 2011 at 9:57 PM ][87] [ ![][49] ][88]

![][89][ ![][90]][91]

[Harish B][91] said... 
: 

How to measure the time taken by a single context switch? Is it same for every context switch or it varies? 

:  [ March 4, 2012 at 4:45 AM ][92] [ ![][49] ][93]

![][94][ ][95]

[phantomfive][95] said... 
: 

Excellent work! 

:  [ December 13, 2012 at 2:25 PM ][96] [ ![][49] ][97]

![][98][ ![][99]][100]

[Пабел Синглит][100] said... 
: 

Thanks a lot! Your investigation helped me great! 

:  [ January 27, 2013 at 2:06 AM ][101] [ ![][49] ][102]

![][55]

Anonymous said... 
: 

This is very helpful. Thanks a lot 

:  [ May 29, 2013 at 11:30 PM ][103] [ ![][49] ][104]

![][105][ ][106]

[Yvan Gadeau][106] said... 
: 

Hello,   
your article is very interesting and helpful, thanks!  
  
I misunderstand something : You're speaking about context switching without specify each time "process context switch" or "thread context switch". For me there is a huge difference, threads share the same virtual space memory. Since threads belong to a same process and a process is executed in 1 processor core (Am I right till here?), can we really have a thread context switch between 2 cores? Or your graphs only represent process context switch?  
I find the difference between threads context switch and process context switch a bit blurred in your explanation.  
Could you explain me?  
  
Thank you very much  
  
Yvan Gadeau  

:  [ July 4, 2013 at 8:51 AM ][107] [ ![][49] ][108]

![][94][ ][95]

[phantomfive][95] said... 
: 

It turns out switching between threads and processes isn't significantly different, except in some special cases.  
  
So you can use them as a representation for either threads or processes (if that answer isn't precise enough for you, please make your own test and post the results! It will be interesting.) 

:  [ July 4, 2013 at 9:02 AM ][109] [ ![][49] ][110]

![][105][ ][106]

[Yvan Gadeau][106] said... 
: 

Yes but differences of performances with and without cpu affinity only applies to process context switch and not for thread context switch. Do you agree?  
  
I don't understand how a thread context switch can occur between 2 threads of different cores.  
  
Yvan 

:  [ July 5, 2013 at 6:33 AM ][111] [ ![][49] ][112]

![][94][ ][95]

[phantomfive][95] said... 
: 

If you only have two threads on two different cores, then yeah, you're probably not doing context switches (but you could have caching issues) 

:  [ July 5, 2013 at 9:57 AM ][113] [ ![][49] ][114]

![][115][ ![][116]][71]

[Benoit Sigoure][71] said... 
: 

As far as the Linux kernel's scheduling is concerned, there are no threads or processes. Everything is just a "task".  
  
If you have a process with one thread, then there is one task that has that PID. If you have a process with three threads, then there are three tasks that share the same PID (but have different TID). But the scheduler doesn't care, all it sees is tasks that want to run, and its goal is to schedule them somewhere.  
  
The only difference is that when you switch from one task to another, and both tasks share the same virtual address space, then no TLB flush occurs.  
  
So yes if you have multiple cores (whether they are all in the same physical CPU or you have multiple CPUs), one core could be executing one thread of a process, and the next time quantum could be given to either another thread of that same process, or another process altogether.  
  
Also possible is the event where one thread is running on a core, and the next time quantum it gets immediately is on another core. This would yield suboptimal performance, especially if both cores are not on the same physical CPU. 

:  [ July 5, 2013 at 10:34 AM ][117] [ ![][49] ][118]

![][55]

Anonymous said... 
: 

Thanks for putting this together. 

:  [ September 23, 2013 at 3:13 PM ][119] [ ![][49] ][120]

![][55]

Anonymous said... 
: 

I liked your post. I do not agree with your final assessment about using 1 software thread per hardware thread. What happens when you are waiting for many ms for a DB to get back to you? Should you just hold up all the other jobs in the queue because you refused to multithread. Threading makes a lot of sense when you take into account the distributed nature of modern architectures. 

:  [ April 7, 2014 at 5:53 PM ][121] [ ![][49] ][122]

![][94][ ][95]

[phantomfive][95] said... 
: 

"What happens when you are waiting for many ms for a DB to get back to you?"  
Use non-blocking i/o, it's better for so many reasons. 

:  [ April 7, 2014 at 6:23 PM ][123] [ ![][49] ][124]

![][55]

Anonymous said... 
: 

@phantomfive In fact Microsoft IOCPs (the one thing I love about Windows, esp. before kqueue/epoll) default to the umber of CPUs, but multiplying by 1.5x if you have anything else that could block mixed in is still better than thousands of threads. See http://msdn.microsoft.com/en-us/library/windows/desktop/aa365198%28v=vs.85%29.aspx & "The best overall maximum value to pick for the concurrency value is the number of CPUs on the computer. If your transaction required a lengthy computation, a larger concurrency value will allow more threads to run. Each completion packet may take longer to finish, but more completion packets will be processed at the same time. You can experiment with the concurrency value in conjunction with profiling tools to achieve the best effect for your application."  
  
Interestingly, Solaris and AIX also have something called IOCPs, but I'm not sure how similar they are. http://en.wikipedia.org/wiki/Input/output_completion_port 

:  [ April 13, 2014 at 2:32 AM ][125] [ ![][49] ][126]

![][55]

Anonymous said... 
: 

@phantomfive Also, you're assuming it's 'another-IO-bound.' What about when you're really doing something intense in a thread. In that case, you really _do_ want either another pool of threads you talk to via a pipe, or you want some headroom on the # of threads and "experiment" with the concurrency value. 

:  [ April 13, 2014 at 2:35 AM ][127] [ ![][49] ][128]

![][129][ ][130]

[sourcejedi][130] said... 
: 

There's links in a HN thread about threads. https://news.ycombinator.com/item?id=6979150  
  
[in the video link] Google measured  
  
50ns or less "mode switch"  
~1us minimum context switch - futex, pinned to same core, threads).  
~3us without pinning  
  
They looked at the pinned case. Oddly their conclusion was the time is mainly spent running the kernel cpu scheduler.  
  
Then they showed how to get it down to 200ns without pinning. They want to switch between two threads in the same way your benchmark does. The running one goes to sleep; the sleeping one starts running. They added a new system call that basically just swaps the scheduling state of the two threads (instead of running the full scheduler).  
  
(In a way it sounds similar to Binder IPC calls on Android http://kroah.com/log/blog/2014/01/15/kdbus-details/) 

:  [ June 12, 2015 at 3:20 AM ][131] [ ![][49] ][132]

[Post a Comment][133]

#### [][134][

[Newer Post][135] [Older Post][136] [Home][1]

Subscribe to: [Post Comments (Atom)][137]

| ----- |
| 

## About Me

![My photo][138]

[ Benoit Sigoure ][139]   

[View my complete profile][139]

[ ![][140] ][141]

 | 

## Blog Archive

* [ ►  ][142] [ 2018 ][143] (1)
    * [ ►  ][142] [ January ][144] (1)
* [ ►  ][142] [ 2017 ][145] (1)
    * [ ►  ][142] [ May ][146] (1)
* [ ►  ][142] [ 2013 ][147] (3)
    * [ ►  ][142] [ March ][148] (1)
    * [ ►  ][142] [ February ][149] (1)
    * [ ►  ][142] [ January ][150] (1)
* [ ►  ][142] [ 2012 ][151] (5)
    * [ ►  ][142] [ November ][152] (1)
    * [ ►  ][142] [ October ][153] (2)
    * [ ►  ][142] [ April ][154] (1)
    * [ ►  ][142] [ February ][155] (1)
* [ ►  ][142] [ 2011 ][156] (9)
    * [ ►  ][142] [ October ][157] (1)
    * [ ►  ][142] [ September ][158] (1)
    * [ ►  ][142] [ August ][159] (3)
    * [ ►  ][142] [ July ][160] (1)
    * [ ►  ][142] [ June ][161] (1)
    * [ ►  ][142] [ May ][162] (1)
    * [ ►  ][142] [ March ][163] (1)
* [ ▼  ][142] [ 2010 ][164] (13)
    * [ ►  ][142] [ December ][165] (2)
    * [ ▼  ][142] [ November ][166] (1)
        * [How long does it take to make a context switch?][2]
    * [ ►  ][142] [ October ][167] (2)
    * [ ►  ][142] [ August ][168] (2)
    * [ ►  ][142] [ June ][169] (4)
    * [ ►  ][142] [ February ][170] (2)
* [ ►  ][142] [ 2009 ][171] (5)
    * [ ►  ][142] [ August ][172] (1)
    * [ ►  ][142] [ April ][173] (1)
    * [ ►  ][142] [ March ][174] (1)
    * [ ►  ][142] [ January ][175] (2)
* [ ►  ][142] [ 2008 ][176] (9)
    * [ ►  ][142] [ November ][177] (1)
    * [ ►  ][142] [ October ][178] (1)
    * [ ►  ][142] [ September ][179] (1)
    * [ ►  ][142] [ April ][180] (1)
    * [ ►  ][142] [ March ][181] (5)
* [ ►  ][142] [ 2007 ][182] (4)
    * [ ►  ][142] [ July ][183] (4)

[ ![][140] ][184]

 | 

Copright © Benoit Sigoure. Awesome Inc. theme. Powered by [Blogger][185]. 

[ ![][140] ][186]

[1]: http://blog.tsunanet.net/
[2]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html
[3]: http://en.wikipedia.org/wiki/Nehalem_(microarchitecture)
[4]: http://en.wikipedia.org/wiki/List_of_Intel_Xeon_microprocessors#.22Woodcrest.22_.2865_nm.29
[5]: http://en.wikipedia.org/wiki/Core_(microarchitecture)
[6]: http://en.wikipedia.org/wiki/List_of_Intel_Xeon_microprocessors#.22Harpertown.22_.2845_nm.29
[7]: http://en.wikipedia.org/wiki/Penryn_(microarchitecture)#Penryn
[8]: http://en.wikipedia.org/wiki/List_of_Intel_Xeon_microprocessors#.22Gainestown.22_.2845_nm.29
[9]: http://en.wikipedia.org/wiki/List_of_Intel_Xeon_microprocessors#.22Gulftown.22_.2832_nm.29
[10]: http://en.wikipedia.org/wiki/Westmere_(microarchitecture)
[11]: http://ark.intel.com/products/64594
[12]: http://en.wikipedia.org/wiki/Sandy_Bridge
[13]: http://www.kernel.org/doc/man-pages/online/pages/man2/gettid.2.html
[14]: https://github.com/tsuna/contextswitch/blob/master/timesyscall.c
[15]: http://en.wikipedia.org/wiki/Futex
[16]: http://www.kernel.org/doc/man-pages/online/pages/man2/futex.2.html
[17]: http://people.redhat.com/drepper/futex.pdf
[18]: https://github.com/tsuna/contextswitch/blob/master/timectxsw.c
[19]: http://en.wikipedia.org/wiki/Translation_lookaside_buffer
[20]: https://github.com/tsuna/contextswitch/blob/master/cpubench.sh
[21]: http://en.wikipedia.org/wiki/Native_POSIX_Thread_Library
[22]: http://livegrep.com/search/linux?q=void%5C+switch_mm+file%3Ax86%2Finclude%2Fasm%2Fmmu_context.h
[23]: http://en.wikipedia.org/wiki/Control_register#CR3
[24]: http://en.wikipedia.org/wiki/Page_table
[25]: https://github.com/tsuna/contextswitch/blob/master/timetctxsw.c
[26]: http://www.cs.rochester.edu/u/cli/research/switch.pdf
[27]: http://www.akkadia.org/drepper/cpumemory.pdf
[28]: https://github.com/tsuna/contextswitch/blob/master/timectxswws.c
[29]: http://2.bp.blogspot.com/_kDky9LKewnM/TOD4Zh6tcNI/AAAAAAAAA28/QpcOPSHc-5o/s1600/5150.png
[30]: http://4.bp.blogspot.com/_kDky9LKewnM/TOD4Z4FmQgI/AAAAAAAAA3E/TzQomn-Mjxs/s1600/5150-affinity.png
[31]: http://4.bp.blogspot.com/_kDky9LKewnM/TODqXd3IRWI/AAAAAAAAA20/FOsH2JAvoYQ/s1600/E5520.png
[32]: http://en.wikipedia.org/wiki/Extended_Page_Table
[33]: http://linux.die.net/man/1/taskset
[34]: http://www.kernel.org/doc/man-pages/online/pages/man7/cpuset.7.html
[35]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html "permanent link"
[36]: https://resources.blogblog.com/img/icon18_edit_allbkg.gif
[37]: https://www.blogger.com/post-edit.g?blogID=8260739278874294486&postID=6022649126977734532&from=pencil "Edit Post"
[38]: https://www.blogger.com/share-post.g?blogID=8260739278874294486&postID=6022649126977734532&target=email "Email This"
[39]: https://www.blogger.com/share-post.g?blogID=8260739278874294486&postID=6022649126977734532&target=blog "BlogThis!"
[40]: https://www.blogger.com/share-post.g?blogID=8260739278874294486&postID=6022649126977734532&target=twitter "Share to Twitter"
[41]: https://www.blogger.com/share-post.g?blogID=8260739278874294486&postID=6022649126977734532&target=facebook "Share to Facebook"
[42]: https://www.blogger.com/share-post.g?blogID=8260739278874294486&postID=6022649126977734532&target=pinterest "Share to Pinterest"
[43]: http://blog.tsunanet.net/search/label/Linux
[44]: http://blog.tsunanet.net/search/label/performance
[45]: http://blog.tsunanet.net/search/label/profiling
[46]: http://lh3.googleusercontent.com/zFdxGE77vvD2w5xHy6jkVuElKv-U9_9qLkRYK8OnbDeJPtjSZ82UPq5w6hJ-SA%3Ds35 "Adrian Cockcroft"
[47]: https://www.blogger.com/profile/14695336135416848505
[48]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1290887031708#c5374509791376216491 "comment permalink"
[49]: https://resources.blogblog.com/img/icon_delete13.gif
[50]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=5374509791376216491 "Delete Comment"
[51]: http://img1.blogblog.com/img/blank.gif "techinterview"
[52]: http://www.technicalinterviewquestions.net
[53]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1290896416331#c8230582228875628051 "comment permalink"
[54]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=8230582228875628051 "Delete Comment"
[55]: http://img1.blogblog.com/img/blank.gif "Anonymous"
[56]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1290897807087#c6320852823084004933 "comment permalink"
[57]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=6320852823084004933 "Delete Comment"
[58]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1290898872399#c9061632951754659600 "comment permalink"
[59]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=9061632951754659600 "Delete Comment"
[60]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1290901651179#c15963592163763933 "comment permalink"
[61]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=15963592163763933 "Delete Comment"
[62]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1290911242280#c2838935621057627787 "comment permalink"
[63]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=2838935621057627787 "Delete Comment"
[64]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1290915029456#c5457529009256927491 "comment permalink"
[65]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=5457529009256927491 "Delete Comment"
[66]: http://img1.blogblog.com/img/blank.gif "James Aguilar"
[67]: http://jaguilar.posterous.com
[68]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1290970995112#c548672213998335317 "comment permalink"
[69]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=548672213998335317 "Delete Comment"
[70]: http://lh3.googleusercontent.com/zFdxGE77vvD2w5xHy6jkVuElKv-U9_9qLkRYK8OnbDeJPtjSZ82UPq5w6hJ-SA%3Ds35 "tsuna"
[71]: https://www.blogger.com/profile/06114951663056205324
[72]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1291081463407#c4003364866092957206 "comment permalink"
[73]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=4003364866092957206 "Delete Comment"
[74]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1291081471558#c7938510149857348521 "comment permalink"
[75]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=7938510149857348521 "Delete Comment"
[76]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1291081476743#c416535480921986761 "comment permalink"
[77]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=416535480921986761 "Delete Comment"
[78]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1291081485938#c8761062859994239894 "comment permalink"
[79]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=8761062859994239894 "Delete Comment"
[80]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1291081491970#c6948828891146768697 "comment permalink"
[81]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=6948828891146768697 "Delete Comment"
[82]: https://img1.blogblog.com/img/blank.gif "pankaj@tux"
[83]: http://2.bp.blogspot.com/_ZNd3VQh-9Rs/TPDs6I0DzfI/AAAAAAAAAVg/PydWiTAv6u0/S45-s35/e.png
[84]: https://www.blogger.com/profile/09466735604811747922
[85]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1297747706475#c4006339634678357180 "comment permalink"
[86]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=4006339634678357180 "Delete Comment"
[87]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1297749435403#c3626461904127450973 "comment permalink"
[88]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=3626461904127450973 "Delete Comment"
[89]: https://img1.blogblog.com/img/blank.gif "Harish B"
[90]: http://4.bp.blogspot.com/-FzM9N2asjiY/TrYO5Uu2lhI/AAAAAAAAGQw/UJ2D8aiaips/s35/picture_1.png
[91]: https://www.blogger.com/profile/04958769469465966607
[92]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1330865156437#c4610610192669969792 "comment permalink"
[93]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=4610610192669969792 "Delete Comment"
[94]: http://lh3.googleusercontent.com/zFdxGE77vvD2w5xHy6jkVuElKv-U9_9qLkRYK8OnbDeJPtjSZ82UPq5w6hJ-SA%3Ds35 "phantomfive"
[95]: https://www.blogger.com/profile/12825051005762309891
[96]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1355437537832#c2654644357846406926 "comment permalink"
[97]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=2654644357846406926 "Delete Comment"
[98]: https://img1.blogblog.com/img/blank.gif "Пабел Синглит"
[99]: http://1.bp.blogspot.com/--geVsSjLcMk/TpCm9bBl0OI/AAAAAAAAAEc/kMsbl-1LmvM/s35/%252525D0%25252598%252525D0%252525B7%252525D0%252525BE%252525D0%252525B1%252525D1%25252580%252525D0%252525B0%252525D0%252525B6%252525D0%252525B5%252525D0%252525BD%252525D0%252525B8%252525D0%252525B5%25252B002.jpg
[100]: https://www.blogger.com/profile/11854635690569742744
[101]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1359281206333#c7412990373931418346 "comment permalink"
[102]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=7412990373931418346 "Delete Comment"
[103]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1369895415730#c1315003066547997119 "comment permalink"
[104]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=1315003066547997119 "Delete Comment"
[105]: http://lh3.googleusercontent.com/zFdxGE77vvD2w5xHy6jkVuElKv-U9_9qLkRYK8OnbDeJPtjSZ82UPq5w6hJ-SA%3Ds35 "Yvan Gadeau"
[106]: https://www.blogger.com/profile/12987099862012598906
[107]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1372953095184#c7861280926414176237 "comment permalink"
[108]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=7861280926414176237 "Delete Comment"
[109]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1372953764622#c5360704336617243236 "comment permalink"
[110]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=5360704336617243236 "Delete Comment"
[111]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1373031225642#c3210380611566318639 "comment permalink"
[112]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=3210380611566318639 "Delete Comment"
[113]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1373043475199#c921547385600817491 "comment permalink"
[114]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=921547385600817491 "Delete Comment"
[115]: https://img1.blogblog.com/img/blank.gif "Benoit Sigoure"
[116]: http://lh4.googleusercontent.com/-2eVJcyL_RNo/AAAAAAAAAAI/AAAAAAAAAAA/GWKq6sXj_VE/s35-c/photo.jpg
[117]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1373045646152#c3679644169332966608 "comment permalink"
[118]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=3679644169332966608 "Delete Comment"
[119]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1379974402779#c2912549417215402664 "comment permalink"
[120]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=2912549417215402664 "Delete Comment"
[121]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1396918385196#c2785652551009395605 "comment permalink"
[122]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=2785652551009395605 "Delete Comment"
[123]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1396920184247#c5933216460990410993 "comment permalink"
[124]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=5933216460990410993 "Delete Comment"
[125]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1397381571625#c3488865626228196453 "comment permalink"
[126]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=3488865626228196453 "Delete Comment"
[127]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1397381721231#c3455579663871355391 "comment permalink"
[128]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=3455579663871355391 "Delete Comment"
[129]: http://lh3.googleusercontent.com/zFdxGE77vvD2w5xHy6jkVuElKv-U9_9qLkRYK8OnbDeJPtjSZ82UPq5w6hJ-SA%3Ds35 "sourcejedi"
[130]: https://www.blogger.com/profile/11597478293075004448
[131]: http://blog.tsunanet.net/2010/11/how-long-does-it-take-to-make-context.html?showComment=1434104430362#c4684874120780147168 "comment permalink"
[132]: https://www.blogger.com/delete-comment.g?blogID=8260739278874294486&postID=4684874120780147168 "Delete Comment"
[133]: https://www.blogger.com/comment.g?blogID=8260739278874294486&postID=6022649126977734532
[134]: 
[135]: http://blog.tsunanet.net/2010/12/opentsdb-at-strata11.html "Newer Post"
[136]: http://blog.tsunanet.net/2010/10/threaderror-cant-start-new-thread.html "Older Post"
[137]: http://blog.tsunanet.net/feeds/6022649126977734532/comments/default
[138]: http://lh4.googleusercontent.com/-2eVJcyL_RNo/AAAAAAAAAAI/AAAAAAAAAAA/GWKq6sXj_VE/s80-c/photo.jpg
[139]: https://plus.google.com/117435881756559768436
[140]: https://resources.blogblog.com/img/icon18_wrench_allbkg.png
[141]: //www.blogger.com/rearrange?blogID=8260739278874294486&widgetType=Profile&widgetId=Profile1&action=editWidget&sectionId=footer-2-1 "Edit"
[142]: javascript:void(0)
[143]: http://blog.tsunanet.net/2018/
[144]: http://blog.tsunanet.net/2018/01/
[145]: http://blog.tsunanet.net/2017/
[146]: http://blog.tsunanet.net/2017/05/
[147]: http://blog.tsunanet.net/2013/
[148]: http://blog.tsunanet.net/2013/03/
[149]: http://blog.tsunanet.net/2013/02/
[150]: http://blog.tsunanet.net/2013/01/
[151]: http://blog.tsunanet.net/2012/
[152]: http://blog.tsunanet.net/2012/11/
[153]: http://blog.tsunanet.net/2012/10/
[154]: http://blog.tsunanet.net/2012/04/
[155]: http://blog.tsunanet.net/2012/02/
[156]: http://blog.tsunanet.net/2011/
[157]: http://blog.tsunanet.net/2011/10/
[158]: http://blog.tsunanet.net/2011/09/
[159]: http://blog.tsunanet.net/2011/08/
[160]: http://blog.tsunanet.net/2011/07/
[161]: http://blog.tsunanet.net/2011/06/
[162]: http://blog.tsunanet.net/2011/05/
[163]: http://blog.tsunanet.net/2011/03/
[164]: http://blog.tsunanet.net/2010/
[165]: http://blog.tsunanet.net/2010/12/
[166]: http://blog.tsunanet.net/2010/11/
[167]: http://blog.tsunanet.net/2010/10/
[168]: http://blog.tsunanet.net/2010/08/
[169]: http://blog.tsunanet.net/2010/06/
[170]: http://blog.tsunanet.net/2010/02/
[171]: http://blog.tsunanet.net/2009/
[172]: http://blog.tsunanet.net/2009/08/
[173]: http://blog.tsunanet.net/2009/04/
[174]: http://blog.tsunanet.net/2009/03/
[175]: http://blog.tsunanet.net/2009/01/
[176]: http://blog.tsunanet.net/2008/
[177]: http://blog.tsunanet.net/2008/11/
[178]: http://blog.tsunanet.net/2008/10/
[179]: http://blog.tsunanet.net/2008/09/
[180]: http://blog.tsunanet.net/2008/04/
[181]: http://blog.tsunanet.net/2008/03/
[182]: http://blog.tsunanet.net/2007/
[183]: http://blog.tsunanet.net/2007/07/
[184]: //www.blogger.com/rearrange?blogID=8260739278874294486&widgetType=BlogArchive&widgetId=BlogArchive1&action=editWidget&sectionId=footer-2-2 "Edit"
[185]: https://www.blogger.com
[186]: //www.blogger.com/rearrange?blogID=8260739278874294486&widgetType=Attribution&widgetId=Attribution1&action=editWidget&sectionId=footer-3 "Edit"

  [*[11/14/2010 08:53:00 PM]: 2010-11-14T20:53:00-08:00

