example of threads using generators for fibonacci and prime numbers