Ok, my story is as follows:
I have created a server app for work that reads records within a database does some boring stuff and write files. After a lot of coffee and more sleepless nights than when I had my 2 children, it was in a "good" beta phase. Tested it with a few million records and it works fine. Ok a mem leak here and there BUT it did take a few days to run
So I have looked at the code and it looks like its time for pthreads. I got a book of amazon which has helped me learn the basics but what I am asking you guys is as follows:
1: Whats the best way of implementing a safe "write to log" function? From what I can see, as long as I mutex the function to write I should be ok. But doesnt that create bottleknecks?
2: Although I am on Linux, I am actually coding this on my XP laptop and then recompiling. Has anyone used the pthreads for win or did you guys have some clever code that does stuff lilke IFDEF WIN32 Createthread... ELSE pthread...