<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Title
Step1:  Create Some Data
Step2:  Create An Operation To Execute On The Data
Step3:  Traditional Approach
Step4:  Parallelism Approach
<ASSISTANT_TASK:>
Python Code:
from multiprocessing import Pool
from multiprocessing.dummy import Pool as ThreadPool 
Explanation: Title: Parallel Processing
Slug: parallel_processing
Summary: Lightweight Parallel Processing in Python.  
Date: 2016-01-23 12:00
Category: Python
Tags: Basics  
Authors: Chris Albon  
This tutorial is inspired by Chris Kiehl's great post on multiprocessing.
Preliminaries
End of explanation
# Create a list of some data
data = range(29999)
Explanation: Create Some Data
End of explanation
# Create a function that takes a data point
def some_function(datum):
    # and returns the datum raised to the power of itself
    return datum**datum
Explanation: Create An Operation To Execute On The Data
End of explanation
%%time
# Create an empty for the results
results = [] 
# For each value in the data
for datum in data:
    # Append the output of the function when applied to that datum
    results.append(some_function(datum))
Explanation: Traditional Approach
End of explanation
# Create a pool of workers equaling cores on the machine
pool = ThreadPool() 
%%time
# Apply (map) some_function to the data using the pool of workers
results = pool.map(some_function, data)
# Close the pool
pool.close() 
# Combine the results of the workers
pool.join() 
Explanation: Parallelism Approach
End of explanation
<END_TASK>