Solved

implement the token ring algorithm using socket programming

Posted on 2004-10-09
9
3,072 Views
Last Modified: 2008-03-17
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
Comment
Question by:prashanth_gurijala
  • 4
  • 2
  • 2
  • +1
9 Comments
 

Author Comment

by:prashanth_gurijala
ID: 12268651
I want the sample program for the above description using Java and socket programming  and it is urgent .
0
 
LVL 4

Expert Comment

by:91mustang
ID: 12268798
Do you need anything else?
0
 

Author Comment

by:prashanth_gurijala
ID: 12268866
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
 
LVL 9

Accepted Solution

by:
DrWarezz earned 500 total points
ID: 12269573
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 86

Expert Comment

by:CEHJ
ID: 12270665
>>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
 

Author Comment

by:prashanth_gurijala
ID: 12270740
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
 
LVL 4

Expert Comment

by:91mustang
ID: 12271557
when do you need this done by?
0
 

Author Comment

by:prashanth_gurijala
ID: 12273048
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
 
LVL 9

Expert Comment

by:DrWarezz
ID: 12298364
:) ThanQ
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
topping3 challenge 14 70
firstChar challenge 13 107
wordappend challenge 8 145
How to convert String matching to regex in java 4 18
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

911 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now