Re:Don’t Think, Just Defunctionalize
by chriswarbo on Tuesday January 05, 2021 @06:52AM
(#25644585)
> you can specify
It's nice to have the option of specifying such limits, but not all programs are batch jobs. For example, the correct CPU time cap for a HTTP server is infinity. Likewise, if that server were written as a recursive function then the correct stack size would be infinity:
def serve(request):
response = process(request)
socket.send(response)
serve(socket.receive())
In JCL (https://en.wikipedia.org/wiki/Job_Control_Language), you can specify how much CPU time a program can spend, how many pages it can output before the OS kills it, and have to specify what files it reads and writes.
That was useful at a time when CPU time, memory and disk space were scarce and expensive, and still would be useful when sandboxing untrusted code.