Chatroom
 

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Bad Astronomy and Universe Today Forum > General > Off-Topic Babbling
Register FAQ Members List Calendar Mark Forums Read

   

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 25-April-2008, 03:23 PM
tommac's Avatar
tommac tommac is offline
Senior Member
 
Join Date: Mar 2008
Posts: 1,395
Default priority queues

Is there a theory in the study of priority queues that states that as a job gets closer to completion it should become of higher priority?

Basically at work I see all of this low priority work that seems to never get completely done because of its low priority status. My theory with this is that as the low priority stuff gets closer to completion that it should get a higher priority to get it out of the queue.

I am sure this has to have been addresses in CS field.
__________________
http://www.whatisorganicliving.com
http://www.againstthemainstream.com/

"Banned by BAUT" Alumni (2008)
Reply With Quote
  #2 (permalink)  
Old 25-April-2008, 03:28 PM
NEOWatcher's Avatar
NEOWatcher NEOWatcher is offline
Senior Member
 
Join Date: May 2005
Location: the E(e)rie coast
Posts: 7,306
Default

Quote:
Originally Posted by tommac View Post
...I am sure this has to have been addresses in CS field.
From a CS point of view...No. CS is more geared toward time sharing without respect of longevity. If a job has a priority, then it means it will most likely get the resources it needs as it becomes available, and the priority systems make sure that lower priority jobs still get some slice of what's going on. (or not locked completely away).

So; equating it with your example (which I also see a lot at work), the idea would be to set aside time for low priority jobs. As long as there is some time available, then the job will progress at the same pace that it did all along. That is as long as the workload is steady.
__________________
Numbers are not case sensitive. (me)
Reply With Quote
  #3 (permalink)  
Old 25-April-2008, 03:41 PM
tommac's Avatar
tommac tommac is offline
Senior Member
 
Join Date: Mar 2008
Posts: 1,395
Default

This becomes a problem when low priority items are still a priority ... and even though at all times high priority items are a higher priority I think the difference in the prioritorization factors are set to large.

The age of a job ( how long since it was started ) and the closeness to completion should be taken into account at least in the workplace for low priority tasks.


Quote:
Originally Posted by NEOWatcher View Post
From a CS point of view...No. CS is more geared toward time sharing without respect of longevity. If a job has a priority, then it means it will most likely get the resources it needs as it becomes available, and the priority systems make sure that lower priority jobs still get some slice of what's going on. (or not locked completely away).

So; equating it with your example (which I also see a lot at work), the idea would be to set aside time for low priority jobs. As long as there is some time available, then the job will progress at the same pace that it did all along. That is as long as the workload is steady.
__________________
http://www.whatisorganicliving.com
http://www.againstthemainstream.com/

"Banned by BAUT" Alumni (2008)
Reply With Quote
  #4 (permalink)  
Old 25-April-2008, 04:06 PM
hhEb09'1's Avatar
hhEb09'1 hhEb09'1 is offline
Senior Member
 
Join Date: Apr 2005
Location: NC USA
Posts: 7,978
Default

Quote:
Originally Posted by tommac View Post
This becomes a problem when low priority items are still a priority ...
boggle
Quote:
and even though at all times high priority items are a higher priority I think the difference in the prioritorization factors are set to large.
That can be addressed without affecting the "how long since it was started issue"
Quote:
The age of a job ( how long since it was started ) and the closeness to completion should be taken into account at least in the workplace for low priority tasks.
Why? Doesn't a lower priority essentially mean that there is less need for that particular job to exit the queue? Less need than other (higher priority) jobs, right?

The priority scheme itself might allocate resources, and notice that a job was close to finishing (how?), and decide that it would be more efficient to let it finish rather than spend time to swap. But that should already be built in, if it's possible.
Reply With Quote
  #5 (permalink)  
Old 25-April-2008, 04:10 PM
NEOWatcher's Avatar
NEOWatcher NEOWatcher is offline
Senior Member
 
Join Date: May 2005
Location: the E(e)rie coast
Posts: 7,306
Default

Quote:
Originally Posted by tommac View Post
The age of a job ( how long since it was started ) and the closeness to completion should be taken into account at least in the workplace for low priority tasks.
I agree, but I've never heard of any theories to support it. And, this is more of a perception, planning and people issue than it is of a logic or system issue.
Throw some money on the table, and then watch what happens to priorities.
I've also seen lingering projects because the most difficult decisions keep getting delayed. At the end of the project, those are still there, as does final acceptance which won't happen until that project is complete. I don't see much in the way of a theory that can address that either.
__________________
Numbers are not case sensitive. (me)
Reply With Quote
  #6 (permalink)  
Old 25-April-2008, 04:15 PM
geonuc's Avatar
geonuc geonuc is online now
Senior Member
 
Join Date: Dec 2007
Location: Atlanta
Posts: 1,419
Default

CS = computer sciences?
Reply With Quote
  #7 (permalink)  
Old 25-April-2008, 04:18 PM
NEOWatcher's Avatar
NEOWatcher NEOWatcher is offline
Senior Member
 
Join Date: May 2005
Location: the E(e)rie coast
Posts: 7,306
Default

Quote:
Originally Posted by hhEb09'1 View Post
That can be addressed without affecting the "how long since it was started issue"Why? Doesn't a lower priority essentially mean that there is less need for that particular job to exit the queue? Less need than other (higher priority) jobs, right?
Right; in other words, if you want to finish the job, then don't assign a new one with a higher priority. Logically; that is doing the exact opposite of the intended result.
Quote:
Originally Posted by hhEb09'1 View Post
The priority scheme itself might allocate resources, and notice that a job was close to finishing (how?), and decide that it would be more efficient to let it finish rather than spend time to swap. But that should already be built in, if it's possible.
In CS, this is accomplished through queue, resource, and job limits (quotas). There's no way for a higher priority job to even hit the system if a resource has reached it's quota.
__________________
Numbers are not case sensitive. (me)
Reply With Quote
  #8 (permalink)  
Old 25-April-2008, 04:19 PM
NEOWatcher's Avatar
NEOWatcher NEOWatcher is offline
Senior Member
 
Join Date: May 2005
Location: the E(e)rie coast
Posts: 7,306
Default

Quote:
Originally Posted by geonuc View Post
CS = computer sciences?
Yes; For some of us, the context was automatic...sorry.
__________________
Numbers are not case sensitive. (me)
Reply With Quote
  #9 (permalink)  
Old 25-April-2008, 05:28 PM
tdvance's Avatar
tdvance tdvance is offline
Senior Member
 
Join Date: Apr 2006
Location: Bowie, MD
Posts: 1,865
Default

One way to do it is to periodically re-evaluate priorities--if the low-priority job is still low priority (by the same criteria used originially--which MIGHT take into consideration cost, to include time left to complete the job), it stays such, otherwise not. In general, if low-cost meant higher priority (i.e. more bang for buck), which is often the case, then as a task nears completion, its priority would in fact go up. I think the best strategy to achieve this is to have well-defined criteria for prioritization, that takes into account both cost and benefit to finish it given what has already been done, and periodically apply it to all tasks.
__________________
-----
Todd (Bowie, MD, US, North America, Earth, Sol System, Vega region, Local Bubble, Orion arm, Milky Way Galaxy, Local Group, Virgo A Cluster, Virgo supercluster, the universe in which spock is clean shaven)

Quidquid latine dictum sit, altum sonatur.

personal page: http://blog.astrosketches.info
Reply With Quote
  #10 (permalink)  
Old 25-April-2008, 05:59 PM
Moose's Avatar
Moose Moose is online now
Senior Member
 
Join Date: Nov 2002
Location: The Maritimes
Posts: 7,291
Send a message via MSN to Moose
Default

If I remember my OS classes at all, I think "the UNIX way" was to queue up a job lot (not the whole job, but a standard unit of processing time) based on its original priority, and every few cycles, jobs still on the queue get their priority bumped up one level. Keeps low priority jobs from starving, but high priority jobs still get a higher proportion of processing time.

In CS the preemptive scheduler can't tell how much of the job is remaining, so it's not a factor in deciding who gets processor time.
__________________
[Dr. Horrible]___________________________[Penny]
Listen close to everybody's heart________And you believe there's good in everybody's heart
And hear that breaking sound_____________Keep it safe and sound
Hopes and dreams are shattering apart____With hope you can do your part
And crashing to the ground_______________To turn a life around
Reply With Quote
  #11 (permalink)  
Old 25-April-2008, 06:55 PM
NEOWatcher's Avatar
NEOWatcher NEOWatcher is offline
Senior Member
 
Join Date: May 2005
Location: the E(e)rie coast
Posts: 7,306
Default

Quote:
Originally Posted by Moose View Post
If I remember my OS classes at all...
Yes; I can't remember the Unix words, but in the VMS world that was quanta (they're all pretty much the same, so the language might not be different exept for marketing purposes). If a job gets a quanta, it drops back down to it's base priority. Every pass of checking priorities will bump up any of those that haven't recieved thier quanta.
__________________
Numbers are not case sensitive. (me)
Reply With Quote
  #12 (permalink)  
Old 25-April-2008, 07:02 PM
Moose's Avatar
Moose Moose is online now
Senior Member
 
Join Date: Nov 2002
Location: The Maritimes
Posts: 7,291
Send a message via MSN to Moose
Default

I'm pretty sure quanta wasn't the word I'd heard in class. If I remember in a reasonable time-frame, I'll let you know.
__________________
[Dr. Horrible]___________________________[Penny]
Listen close to everybody's heart________And you believe there's good in everybody's heart
And hear that breaking sound_____________Keep it safe and sound
Hopes and dreams are shattering apart____With hope you can do your part
And crashing to the ground_______________To turn a life around
Reply With Quote
  #13 (permalink)  
Old 25-April-2008, 08:11 PM
tommac's Avatar
tommac tommac is offline
Senior Member
 
Join Date: Mar 2008
Posts: 1,395
Default

Quote:
Originally Posted by NEOWatcher View Post
Right; in other words, if you want to finish the job, then don't assign a new one with a higher priority. Logically; that is doing the exact opposite of the intended result.
.
However in the real world the low priority stuff is still supposed to get done while new high priority stuff gets added to the queue continuously.
There is a need to balance it. I guess not the same a computer program.

you get a lot of: "we need this but not tomorrow" but eventually they will ask you for status.
__________________
http://www.whatisorganicliving.com
http://www.againstthemainstream.com/

"Banned by BAUT" Alumni (2008)
Reply With Quote
  #14 (permalink)  
Old 25-April-2008, 08:15 PM
tommac's Avatar
tommac tommac is offline
Senior Member
 
Join Date: Mar 2008
Posts: 1,395
Default

I like this. In fact much of the "do this when you can" stuff ... has to do with optimizations of the system. they have a way to do something but there is a better way ... not real important but can save time.


Quote:
Originally Posted by tdvance View Post
One way to do it is to periodically re-evaluate priorities--if the low-priority job is still low priority (by the same criteria used originially--which MIGHT take into consideration cost, to include time left to complete the job), it stays such, otherwise not. In general, if low-cost meant higher priority (i.e. more bang for buck), which is often the case, then as a task nears completion, its priority would in fact go up. I think the best strategy to achieve this is to have well-defined criteria for prioritization, that takes into account both cost and benefit to finish it given what has already been done, and periodically apply it to all tasks.
__________________
http://www.whatisorganicliving.com
http://www.againstthemainstream.com/

"Banned by BAUT" Alumni (2008)
Reply With Quote
  #15 (permalink)  
Old 25-April-2008, 08:17 PM
NEOWatcher's Avatar
NEOWatcher NEOWatcher is offline
Senior Member
 
Join Date: May 2005
Location: the E(e)rie coast
Posts: 7,306
Default

Quote:
Originally Posted by tommac View Post
However in the real world the low priority stuff is still supposed to get done while new high priority stuff gets added to the queue continuously.
Right, and in the computer world... that's when servers crash.
__________________
Numbers are not case sensitive. (me)
Reply With Quote
  #16 (permalink)  
Old 25-April-2008, 08:20 PM
tommac's Avatar
tommac tommac is offline
Senior Member
 
Join Date: Mar 2008
Posts: 1,395
Default

Quote:
Originally Posted by Moose View Post
I'm pretty sure quanta wasn't the word I'd heard in class. If I remember in a reasonable time-frame, I'll let you know.
clock cycle?
__________________
http://www.whatisorganicliving.com
http://www.againstthemainstream.com/

"Banned by BAUT" Alumni (2008)
Reply With Quote
  #17 (permalink)  
Old 25-April-2008, 08:21 PM
tommac's Avatar
tommac tommac is offline
Senior Member
 
Join Date: Mar 2008
Posts: 1,395
Default

Quote:
Originally Posted by NEOWatcher View Post
Right, and in the computer world... that's when servers crash.
if its windows.
__________________
http://www.whatisorganicliving.com
http://www.againstthemainstream.com/

"Banned by BAUT" Alumni (2008)
Reply With Quote
  #18 (permalink)  
Old 25-April-2008, 08:40 PM
Moose's Avatar
Moose Moose is online now
Senior Member
 
Join Date: Nov 2002
Location: The Maritimes
Posts: 7,291
Send a message via MSN to Moose
Default

Quote:
Originally Posted by tommac View Post
clock cycle?
Nope. Clock cycle is to quanta (still haven't remembered the word) what atom is to brick.
__________________
[Dr. Horrible]___________________________[Penny]
Listen close to everybody's heart________And you believe there's good in everybody's heart
And hear that breaking sound_____________Keep it safe and sound
Hopes and dreams are shattering apart____With hope you can do your part
And crashing to the ground_______________To turn a life around
Reply With Quote
  #19 (permalink)  
Old 25-April-2008, 09:25 PM
CodeSlinger's Avatar
CodeSlinger CodeSlinger is offline
Senior Member
 
Join Date: Jul 2007
Location: Gilead-that-Was
Posts: 746
Default

Time slice?
__________________
"It's over you head now. Time to get some professional help." - My fortune cookie from lunch

Ned Wright's Cosmology Tutorial

Usenet Physics FAQ
Reply With Quote