Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8745247
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:58:34+00:00 2026-06-13T11:58:34+00:00

I am trying to develop a chat server in erlang, and i want to

  • 0

I am trying to develop a chat server in erlang, and i want to broadcast messages between a group of processes, i came out with three alternatives

  1. send every message to master process which sends the message to
    the rest of the group, it looks like a bottleneck to me !.
  2. use a global ets table which contains all the pids of the group
    (excessive copying).
  3. use upd multicast.
  4. pg module which is the same as 1.

what is the best approach , is there other alternatives ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T11:58:35+00:00Added an answer on June 13, 2026 at 11:58 am

    Multi-casting in Erlang is unicasting to each recipient. There is no way to broadcast information other than that. Since you only have a small count of processes I don’t think you will have any problems with copying at all. At least I wouldn’t worry too much about it until it becomes the bottleneck of the system.

    Don’t underestimate keeping a process which works as the multicaster for a group. It may be a simple solution, although just keeping the pid()’s in an ETS table or using gproc for it may be rougly the same.

    Worrying about excessive copying is probably not going to be fruitful in the beginning. A trick here could be to store the message as a large binary and then send it around. Then, as Marcelo writes, you will only get to pass around the reference.

    The solution by Vance Shipley on linking is one I would avoid. Links are bi-directional and you will have to trap exits to get the exit message. It is probably better to maintain lifetime knowledge via the call erlang:monitor(process, Pid). You will need to do that since a process that leaves has to be removed from the group. Receiving a message of the form {'DOWN', ..., ...} will be a sign you need to take care of cleanup.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i'm trying to develop a client-server chat application using java servlets and mysql(innoDB engine)
I'm trying an example of WebSocket to develop a simple chat. server.js : var
I am trying to develop a live video chat app using flash and rtmfp
I'm trying to develop an application that allows users to chat with each other
I am trying develop an application (C#) to query an LDAP server. I don't
im trying to develop an standalone application with qooxdoo. i want to load each
I'm trying to develop a simple chat application. Here is my chat.js file. var
I'm trying to learn asyncore module. So I decided to develop a chat program.
I am trying to develop a simple chat application, only for study purpose. My
im trying to develop an web server by embedding jetty. So with jetty 7.3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.