Imposing a Limit on the Amount of User-Tasks Running?

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
Perica
Member
Member
Posts: 454
Joined: Sat Nov 25, 2006 12:50 am

Imposing a Limit on the Amount of User-Tasks Running?

Post by Perica »

..
Last edited by Perica on Sat Dec 02, 2006 11:27 pm, edited 2 times in total.
Slasher

Re:Imposing a Limit on the Amount of User-Tasks Running?

Post by Slasher »

I think you should take Tim's advice cause you never know what a user is going to do. Also imposing a limit actually makes the code harder and slower as you keep testing to see that the limit has not yet been reached in all functions that are going to access you process list, every time you allocate a slot, every time you increase and decrease the slot counter, etc
No limit on process list is just dynamic data structures like link lists (simplest), binary trees and co.
if you have a memory allocation function then you can easily have a limitless list of processes.
And for you question yes, 300 hundred will be too much for some users and not enough for others. think of multiple processes having multiple threads.
User avatar
Pype.Clicker
Member
Member
Posts: 5964
Joined: Wed Oct 18, 2006 2:31 am
Location: In a galaxy, far, far away
Contact:

Re:Imposing a Limit on the Amount of User-Tasks Running?

Post by Pype.Clicker »

remember that you will not have one single task per application the user launched. A lot of subsystems (known as "daemons" in unix world) are requiring a task that is almost always inactive and that will become active when the memory gets full, or when a page is spooled to the printer, etc.
Also, if you consider command-line programmings, its not rare to have a lot of processes started (for instance when starting a huge MAKE process): if process are created recursively, then the fixed limit may become a nuisance quicker than you wished.
_mark

Re:Imposing a Limit on the Amount of User-Tasks Running?

Post by _mark »

It really depends on the OS and what it is intended for. 300 is probably to many for a single user real-time OS. It is probably fine for a single user Graphical OS, or even a workstation OS of sorts. But the guys are right, if you intend to have it run any real internet servers or database servers or something like that, it should be dynamic.

Personally I would much prefer a message from my Windows box saying it had to much going on as apposed to how it gets real sluggish and almost un-usable when heavy swapping is going on.

Oh - and my OS is limited to 32.

_mark()
Tim

Re:Imposing a Limit on the Amount of User-Tasks Running?

Post by Tim »

_mark() wrote:Oh - and my OS is limited to 32.
32 threads or 32 processes?
_mark

Re:Imposing a Limit on the Amount of User-Tasks Running?

Post by _mark »

I'm calling them tasks, but it is pretty much a thread that executes an EXE.

Mark
Tim

Re:Imposing a Limit on the Amount of User-Tasks Running?

Post by Tim »

Isn't that a little low? Or are you writing an OS for some embedded system?
_mark

Re:Imposing a Limit on the Amount of User-Tasks Running?

Post by _mark »

LOL - maybe - I'm not sure yet. Right now it is scope creep of my second stage loader. :)

_mark()
Post Reply