thoughtarray
I know beam makes a scheduler per CPU (OS thread); so theoretically I can do something at exactly the same time up to the number of CPUs I have.
What is the best way to kick them all off at the same time? Is my only option to send (via Process.send or Kernel.send) a message to a process running on each scheduler? If I do that, the messages are sent out serially. Any alternative techniques or should that be considered fast enough in this ecosystem?
I posted a similar post, but I think it was too complex to bother with.
Trending in Questions
Hey guys,
I’ve got a huge CSV ( around 10 GB ) that needs to be processed hourly
Do you guys have any suggestions what is the best prac...
New
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #blog-post
- #elixirconf-us
- #elixir-ls
- #ai
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming











Showing Posts 1 to 4- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
benwilson512
The type of question you’re asking I think requires some definitions. There is, at the end of the day, no such thing as truly “at the same time” there is “measured to be within a time bound by an observer”. How tight does the time bound need to be? Why? Who is observing this?
al2o3cr
I think you need to clarify what you mean by “at the same time”, as it’s not well-defined with communicating processes. All it takes is one piece that forces serial behavior to mess things up.
A better approach is to code things to not need guarantees about simultaneity. For instance, in a network-performance situation like your previous post, instead of:
something like:
schneebyte
You could check how others are doing it.
Maybe you could tell your processes to start at a specific point in time
then just have them sleep and check time repeatedly.
/one more thing
I don’t think you can choose the specific scheduler a process is on.
:erlang.system_info(:scheduler_id)I guess if you spawn enough processes under load it should be spread out to all available schedulers.
thoughtarray
Thanks for the replies, all!
@benwilson512, I think the context you might be seeking is in the linked original post. That post didn’t gent any replies; so I made this post much shorter and simpler. By “at the same time”, I mean parallelism. The goal is to squish that time bound as much as possible in BEAM. I know for other languages the solution would be to start a thread per CPU core.
@al2o3cr, yeah, I think my desires are leaving the realm of practical and entering theoretical (at least in BEAM land). I do have a desire for that TCP SYN to drop in on server/listener to be parallel as possible in BEAM land. Insofar as your recommendation, it’s totally the practical way to do it and may end up what I do if I can’t find what I’m looking for.
@schneebyte, I have seen stressgrid, but not the others. Thanks for the links! I had considered a timer-based kick-off, but wasn’t sure the best way to do it in Elixir/Erlang since I was under the impression that time was pretty squishy in BEAM land.
Regarding choosing specific schedulers, I thought PartitionSupervisor would help partition its children across schedulers. Do I have that messed up in my head?