Is it safe to recompile an executable while it's running?

后端 未结 8 2240
再見小時候
再見小時候 2020-12-24 06:36

What happens if I recompile an executable while it\'s running? Does the operating system read all of the executable\'s contents into memory when it starts running it, so it

8条回答
  •  长情又很酷
    2020-12-24 06:57

    It depends. From what I've experienced, on Linux you can still be running a program if you delete it (and it's not too large). But I don't think that's defined behavior.

    As far as the loop goes, depending on how you're invoking the executable, you will likely end out crashing your script when it goes to execute a program that's only halfway been written.

提交回复
热议问题