[erlang-questions] Dirty NIF - classifying as CPU or I/O bound
Jesper Louis Andersen
jesper.louis.andersen@REDACTED
Sun Oct 14 16:46:47 CEST 2018
On Sun, Oct 14, 2018 at 2:42 PM Roger Lipscombe <roger@REDACTED>
wrote:
> If I *don't know* whether the job is going to be CPU bound or I/O bound
> (it executes arbitrary code provided by a third party), am I safest to just
> classify the dirty job as CPU-bound? Or is this warning hinting at a
> disaster of biblical proportions[1] if I even *think* about fudging the
> classification?
>
>
Either classification risks being wrong, so you can't really do any of them
safely. The two classifications exist because IO resources and CPU
resources tend to orthogonally consumed: If we have many IO bound jobs, we
can still run CPU bound jobs and vice versa. But if you don't know what
kind of job you are looking at a priori, you have no way to classify it
correctly.
You *could* run it with some kind of sandbox environment and then make a
guess: If it were IO bound last time, it probably still is. But this is
more involved.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20181014/734d5464/attachment.htm>
More information about the erlang-questions
mailing list