[Question]
  [
I have come across an article where students used network traffic to draw their university on the country's [IPv6](http://en.wikipedia.org/wiki/IPv6) graph. [[image]](http://kep.cdn.index.hu/1/0/409/4091/40917/4091708_d30ae918f92c2d7794e9620cb2cf1321_wm.png)
**Your goal** is simple to tell, but hard to implement. *Draw* the text MAIL (as it is one of the few words that can be read on a 1D graph) on the CPU graph. 
It should look something like this: 
![Result](https://i.stack.imgur.com/DFZPz.gif)
# Elaborating a bit more on what qualifies:
* The code does not need to be cross-platform (so you won't need unknown APIs to deal with).
* You may capture it in any general CPU usage utility that you have.
* The graph looks a bit worse on a different machine: I trust you this time.
* The base CPU usage % must be continuous, so if you generate a random wave and highlight something that looks like the word MAIL, it's obviously cheating.
* You may choose the maximum load to use, but it has to be substantial enough to clearly see it.
* You must follow the linearity of the example. (For M it looks like this: base %, then sudden increase to the specified max, fall gradually to a lower %, rise back to max and sudden drop to the base % again.)
* If it's unreadable, voters will notice after all.
Standard loopholes apply. Post the images too!
  
[Answer]
# Python, ~~358~~ ~~281~~ ~~268~~ ~~221~~ 194 bytes
Monochrome is *so* last year. This uses multiple processes and syscalls to achieve **two color** CPU graphs!
```
import os,time
A='%-99o'%int('t12q2lxqkap48euoej9429cstbnazl63ubyryteo49u',36)
for i in'0123456':
 t=os.fork()
 while t<1:T=int(time.time())%50;(time.sleep,(id,os.urandom)[i<A[T+49]])[i<A[T]](1)
```
Output from Activity Monitor (OS X 10.9):
> 
> ![Activity Monitor CPU Load graph](https://i.stack.imgur.com/QLl3f.png)
> ![Activity Monitor CPU History graph](https://i.stack.imgur.com/T0O6E.png)
> 
> 
> ![Repeats on the CPU History graph](https://i.stack.imgur.com/uorWS.png)
> 
> 
> 
Output from MenuMeters:
> 
> ![MenuMeters output](https://i.stack.imgur.com/xCGVF.png)
> 
> 
> 
All outputs were generated with an update speed of 1s. No significant background tasks were running, though this output quite easily beats out any single-threaded CPU task.
This code assumes you have 8 cores. It should be pretty easy to modify for fewer/more. It is *portable* to Linux/UNIX systems (though it has only been tested on OS X), and should produce the same two-color output for any CPU monitor that can distinguish User from System CPU time.
Essentially, this works by forking off seven processes, each of which will choose to spend 1 second sleeping, spinning in usermode, or spinning the kernel. Spinning in kernel mode is achieved by requesting large globs of data from `/dev/urandom`, which forces the driver backing `/dev/urandom` to spend a lot of "system" CPU cycles.
EDITED [07/21]: Shortened significantly by using `fork()` instead of `multiprocessing.Process` (`/dev/urandom` only works on \*NIX systems anyway so this doesn't reduce portability). Note however that the program now spawns *background* tasks; you may have to `killall Python` (or similar) to get rid of the CPU-eaters.
---
I couldn't resist implementing a few more letters. I got 16 letters, plus a few symbols:
![~/._PIN](https://i.stack.imgur.com/Io1Bv.png)
![ANCHO...](https://i.stack.imgur.com/Otbxv.png)
![...VY](https://i.stack.imgur.com/iBTBP.png)
The complete alphabet is "ACDFHILMNOPTUVWY", with symbols ".\_~/\". There are probably lots more characters that can be represented.
Entirely ungolfed code for the extra letters:
```
from time import*
from multiprocessing import*
chars6 = {
'A': ('123456654321',
      '000123321000'),
'C': ('344556666666',
      '321110000000'),
'D': ('666666655443',
      '000000011123'),
'F': ('66666666666666',
      '00002222244444'),
'H': ('666664444466666',
      '000002222200000'),
'I': ('66666',
      '00000'),
'L': ('666662222222',
      '000000000000'),
'M': ('6665544334455666',
      '0004321001234000'),
'N': ('66665544336666',
      '00003322110000'),
'O': ('3445556666555443',
      '3221110000111223'),
'P': ('666666666555',
      '000003333444'),
'T': ('777776666677777',
      '444440000044444'),
'U': ('6666322236666',
      '4211000001124'),
'V': ('66654322345666',
      '33321000012333'),
'W': ('66542466424566',
      '43210133101234'),
'Y': ('66665433456666',
      '44333000033344'),
'_': ('1111111111',
      '0000000000'),
' ': ('000',
      '000'),
'.': ('12221',
      '10001'),
'~': ('44445544334444',
      '11223322112233'),
'/': ('2234566',
      '0012344'),
'\\': ('6654322',
       '4432100'),
}
s = 'ANCHOVY '
A = '000'.join(chars6[t][0] for t in s)
B = '000'.join(chars6[t][1] for t in s)
t=time()
f=open('/dev/urandom')
def F(n):
 while 1:T=int(time()-t)%len(A);[sleep,[].count,lambda x:f.read(4**9)][(n<int(A[T]))+(n<int(B[T]))](1)
for i in range(7):Process(target=F,args=(i,)).start()
F(7)
```
[Answer]
# C (Intel Core Duo + OS X/Darwin), 248 bytes
```
#include <unistd.h>
#include <mach/mach_time.h>
#define M mach_absolute_time()
main(){char*s="JJJIHGFGHIJJJ@BDFHJJJHFDB@JJJJ@JJJJBBBBBBB";uint64_t i,t,y=1;for(;*s;s++){
for(i=40;i;i--){for(t=M+(*s&15)*9090909;t>M;)y*=7;usleep((11-(*s&15))*9091);}}}
```
This code is about as portable as the Great Pyramid of Cheops. Sorry about that. The values returned from `mach_absolute_time()` are hardware-dependent, but on my machine the value increments about once per nanosecond.
Here's the result:
![The word "MAIL" shown in my CPU history graph](https://i.stack.imgur.com/DmgRk.png)
There are two graphs because the processor has two cores. I set the maximum CPU load to about 90% because the process is liable to switch between cores whenever I call `usleep()`. With a 100% load, the process is chained to one core and the results are illegible ([see this, for example](https://i.stack.imgur.com/np8oR.png))
[Answer]
## Python, 143
```
from time import*
while 1:
 sleep((ord('00012345654321000~~~D:6300036:D~~~000~~~000DDDD~~~~~'[int(time())%52])-48)*0.001);x=10**5
 while x:x-=1
```
Each character of the string corresponds to one second of activity, from the ASCII character `0` (max load) through to `~` (very light load). The program runs on a time-synchronised loop, so you can run multiple instances for nicer results.
I used Python 2.7.6 on OS X with an Intel Core i7, but it should work on other computers with a bit of tweaking (adjust the `0.001`). The screenshot below was taken with significant background activity.
![MAIL](https://i.stack.imgur.com/TDDug.png)
**Update -** I was able to produce a clearer graph with `time()/10` and a lower update frequency:
![MAIL](https://i.stack.imgur.com/RgNBp.png)
And finally, here's a more golfed version (**123 bytes**) and [its result](https://i.stack.imgur.com/5rlkc.png):
```
from time import*
while 1:
 sleep((ord('002464200~~A5005A~~00~~00DDD~~'[int(time()/2)%30])-48)*0.001);x=10**5
 while x:x-=1
```
[Answer]
## Ruby, 150 characters
```
a=(0..15).map{|i|[0.9-3*i*=0.02,i]}
[9,*a[0,11],*(z=a.reverse)[5,11],11,*z,*a,2,11,6,*[0.2]*9].map{|x,y|c=Time.now
1until Time.now-c>x/3
sleep y||x%3}
```
This isn't all that short so far, but in my opinion the output's rather nice, so I figured I'd post this anyway. As with most other solutions, you may have to pin the Ruby process to a certain core by prefixing it with `taskset -c $core`.
The code is a simple combination of spinning/sleeping for a certain amount of time, which *should* make it somewhat portable. Smooth gradients are created by varying the ratio of spin/sleep time.
![MAIL written CPU monitor](https://i.stack.imgur.com/ONyA2.png)
Lowering the CPU sampling frequency makes the edges look a bit better:
![Lower sampling frequency](https://i.stack.imgur.com/P2JVQ.png)
By adding a few more letters to the alphabet (`AILMNUVW` are somewhat recognizable), we can also write some other words:
![MUM, MAW, VILLAIN](https://i.stack.imgur.com/i3bFw.png)
These pictures were generated with the following code:
```
def gradient num_samples, direction, base = 0.3, increment = 0.02, scale = 1
    range = [*0..num_samples]
    samples = case direction
        when :up then range.reverse
        when :down then range
        when :updown then range.reverse + range
        when :downup then range + range.reverse
    end
    samples.map{|i|
        i *= increment
        [base - scale * i, i]
    }
end
# letters are defined as a series of pairs of (spin-time, sleep-time)
# with the time in seconds
THIN_A = gradient(15, :updown, 0.2, 0.2/15)
A = gradient(15, :updown)
I = 2,0
L = 1.5,0, [[0.1,0.2]]*9
M = 2,0, gradient(9, :downup), 2,0
N = 1,0, gradient(9, :down), 2,0
U = 1,0, gradient(9, :downup, 0.1, 0.03, 0.1), 1,0
V = 0.5,0, gradient(12, :downup, 0.25, 0.02), 0.5,0
W = 0.5,0, [gradient(12, :downup, 0.25, 0.02)]*2, 0.5,0
[A,I,L,M,N,U,V,W].map{|i|
    # add 2 second pause after each letter
    i + [0,2]
}.flatten.each_slice(2){|x,y|
    # spin, then sleep
    c = Time.now
    1 until Time.now-c > x
    sleep y
}
```
Words that can be written with the implemented letters can be found with
```
grep -E '^[aijlmnuvw]+$' /usr/share/dict/words 
```
[Answer]
## Python, on Intel Pentium 4 3.0Ghz, 180 166 145 141 138 bytes
Call with `taskset -c 0 python cpu_graph_drawer.py`.
`taskset` is needed to restrict the process to use only one CPU/core (hyperthreading in my case.)
```
from time import*;c=clock
a=[(3,.8),(3,5),(4,5),(1.3,5),(1.3,0)]
a.extend([(.1,.2)]*10)
for x,y in a:
    t=c()
    while c()-t<x:pass
    sleep(y)
```
Result isn't that great.
![This one with taskset -c 1](https://i.stack.imgur.com/BkYwP.png)
[Answer]
# Java 8, 482 characters
Every character in the String means number of threads, that will be utilized. Image taken on Intel Core i3 (2 cores / 4 threads).
![result](https://raw.githubusercontent.com/todvora/todvora.github.io/master/images/409.png)
```
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
public class Mail{
public static void main(String[] args) throws InterruptedException{
Thread.sleep(15000);
for(char c:"123432234321000012343210000444000044441111111".toCharArray()){
ExecutorService executorService = Executors.newScheduledThreadPool(4);
for(int i=1;i<c-48;i++)executorService.execute(()->{while(!Thread.interrupted());});
Thread.sleep(1500);
executorService.shutdownNow();
}}}
```
**Edit**: more golfed version (322 chars), same functionality:
```
import java.util.concurrent.*;
class M{
public static void main(String[]a)throws Exception{
for(int c:"123432234321000012343210000444000044441111111".toCharArray()){
ExecutorService s=Executors.newFixedThreadPool(4);
while(c>48){c--;s.execute(()->{while(!Thread.interrupted());});}
Thread.sleep(1500);
s.shutdownNow();
}}}
```
[Answer]
# C, 78 bytes
You never said we couldn't accept user input, sooo..
```
#include <unistd.h>
int main(){int x=0;for(;x<1<<26;++x);read(0,&x,1);main();}
```
This program reads from standard in and every time it reads a character it executes a gratuitous CPU wasting for loop, then calls main again. You control the amount of CPU time it uses by spamming the enter key at different speeds.
I ran this on an intel i3 4130T, which is a reasonably new processor. But your mileage may vary, if it's using more or less CPU time than is practical for you to observe, try playing with the shift amount in the delay loop.
My program is awesome because it:
* is mostly cross platform, it should work with very little fiddling on any \*nix
* defeats the question
* great endgame play
After a few tries I produced a graph that looked like this:![CPU graph](https://i.stack.imgur.com/iYHR3.png)
]