I'm not sure if you are using VC++ 6.0 or Visual Studio .NET. Help on the _pipe function is available there.
If not, here's a link to MSDN on the _pipe function:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vccore98/html/_crt__pipe.aspTo use _pipe you would be going outside of ANSI C. (Note: Microsoft uses the leading underscore in their functions that are extensions outside the ANSI C standard library functions.)
You would also be going outside standard C to use CreateThread, but at least the Win32 API would be supported whether you are trying to code a Windows app or a console app.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/createthread.aspThe _beginthread documentation also comes with this warning:
"
Warning The multithread library LIBCMT.LIB includes the _beginthread and _endthread functions. The _beginthread function performs initialization without which many C run-time functions will fail. You must use _beginthread instead of CreateThread in C programs built with LIBCMT.LIB if you intend to call C run-time functions."
The return value is a handle to the thread and you communicate with that thread through the handle and through a pointer to the data you want to send to the thread. The data are allocated from the process heap that spawns the thread. Here is a simple example:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/base/thread_handles_and_identifiers.aspI still think you should test your application using fopen() directly in the main thread and time the impact of latency and actually determine how long it takes Windows to open and write to a local file and a remote file before you go to the trouble of writing a thread for this. Windows does a lot of file buffering for you and I would say that you could probably write it in a single thread with little or no impact to your server. I'd like to hear what kind of delays you get when opening a network file.
Look for a file named nmpipe.c in the MSDN documentation for a sample pipe program.
Look for BOUNCE.C for a sample multithreaded application that uses _beginthread.