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 3427924
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T06:53:49+00:00 2026-05-18T06:53:49+00:00

I am implementing a chat server in Erlang . According to my design, each

  • 0

I am implementing a chat server in Erlang. According to my design, each client has a corresponding agent process on the server node that handles the messages. I am writing the PIDs of the agents into database so that I can exchange messages between them.

Is it safe when I kill the PIDs? For example, after my server restarts, the PIDs are still in the database (but the processes will die), will there be chances that the PIDs in the database clash with some other (newly created) important processes?

If so I cannot simply kill the agent when the client is not responding. So far, I have not observed it, but it would be nice to know for sure.

  • 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-05-18T06:53:49+00:00Added an answer on May 18, 2026 at 6:53 am

    PIDs are assigned in spawn order from 0.0.0 (init) every time the node is started. So yes, you can easily get PID collisions if you save them between node restarts.

    You’ve built some kind of registry to allow you to look up the PID for a particular client – this registry needs to remove dead PIDs in a timely manner. A typical design is for the registry to monitor (erlang:monitor/2) each registered process and remove the registry entry when the process dies and the {'DOWN', Ref, process, Pid, Info} message is received.

    I would also add that storing a PID outside erlang (if your database is not ets or mnesia) is unusual for this reason – the PID won’t mean anything after the process or node dies.

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

Sidebar

Related Questions

What's my best bet for implementing a simple chat client (2-person) in an ASP.NET
I'm implementing a document server. Currently, if two users open the same document, then
I'm writing a TCP chat server ( programming language does not mather ). It's
which one is better for implementing chat for the iPhone with users in the
I was thinking of implementing real time chat using a PHP backend, but I
Implementing custom DataAnnotationsModelMetadataProvider in ASP.NET MVC2. Assuming the object that is being rendered looks
When implementing SuperBoxSelect (http://www.sencha.com/forum/showthread.php?69307-3.x-Ext.ux.form.SuperBoxSelect), I've realized that it currently does not support shift +
Is implementing a code generator a sort of model driven design/ model driven software
Implementing Equals() for reference types is harder than it seems. My current canonical implementation
Implementing a 'sandbox' environment in Python used to be done with the rexec module

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.