As soon as I have time I'll make a version of the threaded code using gnu pthread library and post it here just in case it is useful for someone.
Once again thanks for all the really useful information!