Java Forums

Main Menu
Home
Today's Posts
FAQ
Search
Contact Us

Java Network
Linux Archive
Java Tips
Java Tips Blog

Sponsored Links





Welcome to the Java Forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community, you will:

  • have access to post topics
  • communicate privately with other members (PM)
  • not see advertisements between posts
  • have the possibility to earn one of our surprises if you are an active member
  • access many other special features that will be introduced later.

Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 10-13-2008, 07:45 AM
Member
 
Join Date: Oct 2008
Posts: 2
raghuylin is on a distinguished road
Help of Thread and some Algorithm
Hi Friends,

I need to write an algorithm (formula) for one of my program, the logic is below.

I have a thread running and it receives a dynamic double value which may range between 1 - 10 or 1 - 20. ( These range are known before i.e we will set the minimum and maximum dynamic value as constant). Now i need a logic like when this dynamic value is 1 (minimum value) my thread should run in minimum speed ( i.e sleep for 1000 milli sec), or if my dynamic value is 10 (20) (maximum value) my thread should run in maximum speed(i.e sleep for 200 milisec). This minimum and maximum speed of thread is also set before in a constant. the dynamic value may change @ any time between the range we have set. Please help me to produce a algorithm or formula for this. Thanks in advance

-Raghu
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 10-13-2008, 04:07 PM
Norm's Avatar
Senior Member
 
Join Date: Jun 2008
Location: Heredia, Costa Rica
Posts: 2,223
Norm is on a distinguished road
If we do your HW how are you going to exercise your brain enough to learn how to program?

Do some work on this and comeback when you get stuck.
Bookmark Post in Technorati
Reply With Quote
Sponsored Links
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
how high-priority thread allow other thread rameshkr Threads and Synchronization 3 09-10-2008 05:16 PM
passing a value from parent thread to child thread sachinj13 Threads and Synchronization 7 09-07-2008 11:06 PM
data from the main/GUI thread to another runnin thread... cornercuttin Threads and Synchronization 2 04-24-2008 12:30 AM
If JNI thread call the java object in another thread, it will crash. skaterxu Advanced Java 0 01-28-2008 09:02 AM
Creating a Thread (extending Java Thread Class) JavaForums Java Blogs 0 12-19-2007 11:31 AM


All times are GMT +3. The time now is 08:36 PM.


VBulletin, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org