Forum: Ruby Updating running ruby scripts

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2ebf42f8625b86c0e91ae7bd4e2bef52?d=identicon&s=25 Raymond O'Connor (nappin)
on 2007-06-25 07:33
Hi,
I've got a few small ruby scripts that run every 15 minutes or so from
cron that do processing from a database.  I was wondering if it is
dangerous to update these programs (basically an svn update) while they
are running.  They don't read any files while they are running, just
work off a db.  I guess this isnt a Ruby question per say, but basically
my question is, is the entire ruby script loaded into memory when it
launches? So any change to the rb file itself wouldn't affect the
program until it was launched again?

Thanks,
Ray
918c6daad03c85e51ad1a11f57017947?d=identicon&s=25 Devin Mullins (twifkak)
on 2007-06-25 07:40
(Received via mailing list)
Raymond O'Connor wrote:
> work off a db.  I guess this isnt a Ruby question per say, but basically
> my question is, is the entire ruby script loaded into memory when it
> launches?

AFAIK, the entire Ruby file is parsed into an AST before any of it is
evaluated. However, if your script is split up into multiple files, I
imagine there could be a .001% race condition where Ruby loads an
impartially-updated code base.

(Note: The preceding email was written by a team of intoxicated monkeys,
and may not be in any way true.)
This topic is locked and can not be replied to.