concurrency in mongrel


I would like to know if it is possible to implement concurrency in mongrel. I have a simple controller in my application which writes data to a file. How can I synchronize the file access? I've read a few posts on the net regarding the issue, and everyone is saying that it should not be done since Rails is not thread-safe. However, this seems to be a pretty common thing. Is there no solution for this problem?

Thanks, Tiberiu