I would like to know if freeglut is thread safe.  Specifically, I would like to have a child thread handle all of the windowing and user interaction. The reason for this is that I have a lot of existing scientific code that does not currently display any of the data that it computes.  What I would like to do is develope a library that would allow me to very easily plot data as computation proceeds.  I want the change to the existing code to be minimal,  for instance simply inserting a call like surface(data);  into the code should open a window and plot the matrix data held in "data" to the screen like matlab would for instance.  It seems that to do this I need to call the glutMainLoop in a secondary thread so that the scientific code can continue executing in the main thread.  However, I have found that glut is not thread safe and does not support calling the glutMainLoop function from any thread other than the main thread.  I would like to know if this is also the case with freeglut.  Or if you have any suggestions for how to impliment this type of graphics library.