• Post Reply Bookmark Topic Watch Topic
  • New Topic

Need Thread Handling Algorithm

 
pravinth Ganesan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello Java Experts,
I need Some/Any thread handling(or any algorithms) which must be implemented in java. I need both the algorithm and its implementation in java. Thanks in Advance
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Your question is quite unclear about what you're trying to accomplish; try to be more specific. Java has threads built in, via the Thread class and the Runnable interface, if that is any help.

It's unlikely that someone here will do all the work for you, and describe an algorithm, and come up with an implementation. But if you describe where you have problems doing this, we will be happy to help.
 
pravinth Ganesan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
cmonnnn
I don't have enough time.
If u know any link plz direct me
Thanks for ur reply.
Any other help plz
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still don't know what you're asking. If you don't have time to describe your problem, I doubt you'll get an answer.
Ease up.
Patience is a virtue.
[ October 23, 2005: Message edited by: Ulf Dittmer ]
 
pravinth Ganesan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Helloooooooooooo
I need a java program which can implement any "Token Passing" algorithm(for example:"suzuki-kasami" algorithm), or mutual-exclusion algorithm.
Hope atleast now u understand my need.
Than You.
Any body who know it plz help me.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
My guess is that he's a student with an assignment due tomorrow, something along the lines of "Implement something, anything, using Threads." Sorry, friend. You won't get any help here. We're interested in helping people learn Java, but in general we couldn't care less about anyone's Comp Sci grades as an end in themselves.
 
Scott Selikoff
author
Bartender
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yeah, I agree, sounds like a student. Its not often I sit down and say to myself "Yeah, I need a thread algorithm to solve this problem, but ANY thread algorithm will fix it!".
 
pravinth Ganesan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes i am a student - computer science eng. student.
We have an assignment to implement any algorithm related to advanced operating system.
Help me
 
Scott Selikoff
author
Bartender
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I think we would help a little if you came to us with an algorithm or sketch of an algorithm that you were having trouble with and needed help filling in the missing pieces.

No ones going to just sit down and do your homework for you, besides you may have to do this one day in practice and I doubt your boss is going to be happy if you copy/steal another algorithm that you don't even understand.
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Scott Selikoff:
I think we would help a little if you came to us with an algorithm or sketch of an algorithm that you were having trouble with and needed help filling in the missing pieces.

No ones going to just sit down and do your homework for you, besides you may have to do this one day in practice and I doubt your boss is going to be happy if you copy/steal another algorithm that you don't even understand.


Not only that, but we won't be happy when he's someone we have to work with because they got the job based upon a degree some forums did the work to get.
 
Scott Selikoff
author
Bartender
Posts: 4033
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Not only that, but we won't be happy when he's someone we have to work with because they got the job based upon a degree some forums did the work to get.


So you're saying we should get hisdegree? I like where this is going...
 
Ken Blair
Ranch Hand
Posts: 1078
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Actually I was inferring that working with incompetent colleagues because they got their answers off a forum instead of earning a degree is frustrating as hell. Fortunately, I don't have to deal with that, usually.
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24213
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Let's be nice, guys.
 
pravinth Ganesan
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,
Its OKay?!!!.
I decided to do Round robin sceduling algo. -if i can't achieve it i will post here. until take care bye.
 
Henry Wong
author
Sheriff
Posts: 22537
109
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by pravinth ravinth Ganesan:
Hi Friends,
Its OKay?!!!.
I decided to do Round robin sceduling algo. -if i can't achieve it i will post here. until take care bye.


All modern JVMs integrate the threading system into the OS thread system -- which in turn, all implement some form of round robin schedulling. In fact, for Windows, round robin schedulling is done even amoung threads with different priorities.

However, assuming you are able to find an old version that does not implement round robin schedulling... Here is how you would implement a round robin scheduler:

- Create a new thread with this code.



- Kick the priority to Max Priority.

Every time this thread wakes up, it will grab the CPU, and immediately go back to sleep, which hopefully, will give the CPU to another thread.

Henry
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!