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

  • Home
  • SEARCH
  • 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 6863305
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T02:45:59+00:00 2026-05-27T02:45:59+00:00

I am looking to create a distributed framework in Java and need some help

  • 0

I am looking to create a distributed framework in Java and need some help sorting out the implementation of a client/manager/worker situation as described in my pseudocode below.

Manager
BEGIN
    WHILE(true)     
        RECEIVE message FROM client
            IF (worker_connections > 0) THEN            
            FOR (i=0;i<worker_connections;i++) 
                SEND message TO worker[i]
            FOR (i=0;i<worker_connections;i++) 
                RECIEVE result[i] FROM worker[i]             
            SEND merge(result[]) TO client
            ELSE            
            SEND "No workers available" TO client
            END IF
    END WHILE
END

Client
BEGIN
    RECEIVE message FROM user
    SEND message TO manager
    RECEIVE message FROM manager
END

Worker
BEGIN
    WHILE(true)
        RECEIVE message FROM manager
         result = doSomething(message)
         SEND result TO manager
    END WHILE
END

So far I have implemented the client as described in the pseudocode but i’m having problems with the manager/worker part so at the moment the client just receives the message that no workers are available. The manager can accept multiple connections, each connection is run as a thread but how do I differentiate between a client connection and worker connection? How do I keep track of the number of workers currently connected?

The client, manager and workers are representations of different machines however I am only developing on one machine (in Java).

  • 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-27T02:46:00+00:00Added an answer on May 27, 2026 at 2:46 am
    • Q. How do I differentiate between a client connection and worker connection?
    • A. Use two ports, one to listen to connections from workers and one from clients.
    • Q. How do I keep track of the number of workers currently connected?
    • A. Have a registration mechanism (maybe in a list of workers) to register/deregister each time a worker connects/disconnects.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Looking for some help on the best way to create a custom UIActivityIndicator. I
I looking to create a custom calender with Zend Framework, I am hoping that
I am looking to create symlinks (soft links) from Java on a Windows Vista/
Looking to create a list like this: 1. Section Header 1.1 Some Text Here
I`m looking to create two models: trainer & client. When signing up those two
Im looking to create a control that would look like comic baloon. In WPF
I'm looking to create favicon.ico files programatically from Python, but PIL only has support
I'm looking to create an Intellij IDEA language support plugin for Erlang. The first
I am looking to create an expression tree by parsing xml using C#. The
If I were looking to create my own language are there any tools that

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.