ms68
What is the indication of async-threads when starting iex?
What is the indication of async-threads when starting iex?
I couldn’t found anything on the web. I have 8 cores on my machine
and when I launch iex, it prints out async-threads:1
Is there a way to manually increase it?
Marked As Solved
dom
Possibly, but what problem are you hitting exactly?
Also Liked
michalmuskala
Since OTP 21 none of the built-in things use async threads (they migrated to dirty schedulers and dirty NIFs), so it doesn’t make much sense to spawn those threads. There’s still one of them in case you have some custom linked-in port drivers using them.
On previous versions the file ports were using async threads.
Qqwy
What is it what you want to do? Not how you suspect to be able to do it, but what itself is the problem you are attempting to solve? (See the XY problem)
dom
System.cmd spawns external processes. They don’t run inside the Erlang VM, so they don’t use async threads.
NobbZ
So what you actually need seems to be some kind of working queue that limits amount of concurrently spawned processes?
Sounds a bit like GenStage or poolboy or… Well, there are plenty, which you need to pick depending on your exact needs.
dom
A quick way to limit how many run in parallel is to use Task.async_stream/5 with its :max_concurrency option. That may be enough if you have only one process kicking off the tasks. Otherwise you could try fancier rate limiting libraries like safetyvalve or jobs.







