We have written an Sinatra application that uses Thin as its web server and rack as the middleware between the two. I w开发者_Python百科ould like to know if Rack is smart enough to allow concurrent writing to the log file (as defined in the config.ru) without any additional configuration.
I do not have any experience with this specific implementation, but I'm going to guess no since this is more a problem of concurrency when writing to a file then a problem specifically with Rack. The reason for this is that the Operating System typically needs to lock a file to write to it. I would imagine the first process that needed to write to the log file would block other processes until it finished writing and then subsequent processes would be able to write.
For other information check out this answer to a question related to EventMachine here. Also check out File Locking on wikipedia.
精彩评论