Groups > Asp .Net > VS 2005 Web Application Projects > Re: user pipelining/queuing




user pipelining/queuing

user pipelining/queuing
Mon, 10 Mar 2008 16:07:15 +000
Hi everyone,

A friend of mine is making a remote learning web-site and he wants users/members
to log in to web site, use the device which is connected to host computer, and
then log out automatically. If another user attepmts to log in while one is
using the system, he should be added to queue. 

For example:

Paul and Lisa have accounts, and Paul first enters the site then starts the
system. this will take 10 mins max. then at the 4th min. Lisa comes in. Then
program will say her to wait about 6 minutes. If another student Jane wants to
come in she will be the 3rd then she will be able to use the system after Lisa.
Besides, there might be more than 40 students at the queue at the same time. 

Another point is they will be able to chat each other while either working on
the system or waiting at the queue. chat can be public. no need to be so
detailed.

Well, we are trying to make this in VS 2005 using C#. But we cannot make it in
an order. Perhaps somebody out here would like to help.

Greetings.
Post Reply
Re: user pipelining/queuing
Mon, 10 Mar 2008 17:10:21 +000
Use a System.Collections.Generic.Queue.  This will allow you to use whatever
datatype you want (including a custom class, such as user), and it will provide
the queuing techniques requested.  

You cannot programmatically search through a queue, just add to the end of it
and pull from the front of it.  This will have to be a "public static"
variable, though, so all sessions will be able to use the same queue variable.

To figure out the wait time, you'd need to calculate  [  MaxTime x (queue.Count
- 2) + TimeLeftForCurrentUser  ]. (Subtract 1 for the user currently using the
device, another 1 for the current user because he won't have to wait until his
own session is over).
Post Reply
Re: user pipelining/queuing
Sun, 16 Mar 2008 17:50:20 +000
Queue example:
http://msdn2.microsoft.com/en-us/library/system.collections.queue.aspx

Generic queue example: http://msdn2.microsoft.com/en-us/library/7977ey2c.aspx 
(you can use any user-defined class with this, not just String as used in the
example)
Post Reply
about | contact