4 ms·
You can use the dirty scheduler feature in 17.10 to get around the limit (because it creates unmanaged threads). See https://github.com/vinoski/bitwise https:/
by striking 9y ago
You can use the dirty scheduler feature in 17.10 to get around the limit (because it creates unmanaged threads).
See https://github.com/vinoski/bitwise https://github.com/vinoski/bitwise
- jerf 9y agoBut honestly, you're better off with just Don't Do That. It's not what Erlang is meant to do. It's a suitable language to coordinate number crunching if that floats your boat, but it is not a suitable language for the actual crunching. Some people still seem to get very upset when someone proposes that some langauge is not suitable for some use, but there aren't any languages that are the best for everything. The languages in which I would want to write heavy-duty number crunching code will be nowhere near as good as Erlang at writing high-concurrency, high-reliability server code. Also, to avoid a second post, contrary to apparently popular belief it is not possible to just make up for slow code by bringing in a lot of CPUs. Number crunching in Erlang is probably a bare minimum of 50x slower than an optimized implementation, it could easily be 500x slower if it can't use SIMD, and could be... well... more-or-less arbitrarily slower if you're trying to use Erlang to do something a GPU ought to be doing. 5-7 orders of magnitude are not out of the question there. You can't make up even the 50x delta very easily by just throwing more processors at the problem, let alone those bigger numbers.
- striking 9y agoYou're not writing the number crunching code in Erlang, in this example. You're using Erlang to coordinate that number crunching via NIFs (C programs, managed and read from by Erlang). Dirty scheduling enables NIFs that run for longer than 10ms. You're right. Please never implement your number-crunching in Erlang. It will be slow.
- rdtsc 9y ago> Don't Do That. That's exactly what dirty schedulers were made for - run longer blocking C code but without having to do the extra thread + queue bits yourself. > is not possible to just make up for slow code by bringing in a lot of CPUs. It entirely depends on what you are doing. So number crunching could be a small part amongst lots of protocol parsing and binary matching and sending to different backends and so on. Rarely it is just purely a simple executable that runs and multiplies a matrix and exits. In that context it could make sense to start with Erlang and then do dirty scheduler or an drivers or such for number crunching.