• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3851
  • Last Modified:

implement the token ring algorithm using socket programming

S is the central server A,B,C,D are the 4 players
Intially the token is at A
A starts 3 threads and sends the messages to B,C,D and moves the token to B
the acknowledgements are monitored by the central server S in the que buffer in the order in which they are received  from B,C,D and the response in written at A in a string buffer  which it receives from the central server S
when the token is at B it starts 2 threads sending messagesa to C,D and moves the token to C and the the acknowledgements are monitored by the central server S in the que buffer in the order in which they are received from C,D and the response in written at B in a string buffer which it receives from the central server S
when the token is at C it starts 1 thread sending messagesa to D and moves the token to D and the the acknowledgements are monitored by the central server S in the que buffer in the order in which they are received from D and the response in written at C in  a string buffer which it receives from the central server S
when the token is at D it is done
This is the implementation of the token ring algorithm and the central server is used only for receiving the acknowlegements in order at the player
The sends are done asychronously and the receives are done using threads
0
prashanth_gurijala
Asked:
prashanth_gurijala
  • 4
  • 2
  • 2
  • +1
1 Solution
 
prashanth_gurijalaAuthor Commented:
I want the sample program for the above description using Java and socket programming  and it is urgent .
0
 
91mustangCommented:
Do you need anything else?
0
 
prashanth_gurijalaAuthor Commented:
The threads must also use a distributed  mutual exclusion algorithm  in order to collect the messages in the single array buffer .Implement the central server algorithm using a separate thread
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

 
DrWarezzCommented:
I think you'll get more positive responses if you break the question down.. We can't write a whole program for you..

However, I'm guessing you have some java experience, right?

References/Examples:

THREADS
http://www.javaalmanac.com/egs/java.lang/BasicThread.html

SOCKETS
http://www.javaalmanac.com/cgi-bin/search/find.pl?words=sockets

Also, anything else, either search for it at: www.javaalmanac.com, or java.sun.com

Or, if it's a more direct question, of course, just ask it here. :)

gL,
[r.D]
0
 
CEHJCommented:
>>and it is urgent .

I suggest you move to another site. There are ones where you can pay to have your homework done for you
0
 
prashanth_gurijalaAuthor Commented:
My doubt is how to send the response from the reciever to the central server  where a queue is available  which will return the reply to the sender in a single array buffer
0
 
91mustangCommented:
when do you need this done by?
0
 
prashanth_gurijalaAuthor Commented:
hi thanx mustang,
i reall yappreciate this, the deadline is monday night.... I am working on this already and trying to do....

any way thanx for all help and suggestions guys...
-prashanth
0
 
DrWarezzCommented:
:) ThanQ
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

  • 4
  • 2
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now