M
Mage
Hello,
I was thinking of writing my first threaded app in Ruby. One thread
should fetch data from the database, another should write it to a file.
I would like to use an array, which has hash elements. I append new
elements to the end, and I write to the file from the beginning (FIFO).
My question is that do I really need mutex? Is appending a hash to the
end of an array atomic, or not? How can I know which method is atomic?
Mage
I was thinking of writing my first threaded app in Ruby. One thread
should fetch data from the database, another should write it to a file.
I would like to use an array, which has hash elements. I append new
elements to the end, and I write to the file from the beginning (FIFO).
My question is that do I really need mutex? Is appending a hash to the
end of an array atomic, or not? How can I know which method is atomic?
Mage