quick and dirty windows port

d:\kit\pthreads-win32-VC-x64\ is where the pthreadVC2.lib,
pthreadVC2.dll and pthread.h reside on my system. User should be able to
specify the header file location, library name and library location via
config attributes or environment variable (or better yet, code should be made portable, perhaps by using C++11 standard threading classes).

Also, defines that trigger symbol exporting should be passed as -D args to compiler. 

SUMMARY OF THE MAILING LIST ABOUT SOFTWARE VERSION:

Long story short, I switched computers and toolchain versions and got a very strange behaviour: something % 1 = something, instead of something % 1 = 0, which caused ops to fail. After updating msvc from 2008 to 2010 and cuda from 4.2 to 5.0 everything went fine. I also noticed another slightly confusing issue: the console output didn't get updated regularly and training seemed to remain stuck after a few epochs.

The code in Theano was the same. It just had a couple of extra printf statements to help debugging.

I don't really know what caused the code to produce such a strange output, and I couldn't reproduce it, despite trying to compile the same piece of code (including variable types) using the same compiler arguments. This incident kind of made me lose a tiny bit of faith in the deterministic nature of the compilation process. It might have been some misconfiguration of the toolchain (the machine is used for a number of other projects using CUDA as well, and I'm not familiar with its environment configuration), or a bug in nvcc4 or msvc2008, or some temporary files I might have accidentally copied along when switching machines.