Ask a Question related to ASP.NET General, Design and Development.
-
Jason #1
Synchronised queue
I want to create a synchronised queue class which has very simple
functionality as a queue but is thread safe, where two different threads can
add and remove items in such a way that doesn't interfere with each other.
Will the following code suffice. Does the synchronised method return a queue
that can only be accessed by a single thread at any one time.
Also what happens if you try and remove (dequeue) an item when the queue is
empty. Will the thread be blocked until a new item is added to the queue.
Effectively what I am trying to do, is a single producer - single consumer
solution (which fits the requirements fine) without getting into all the
complexities related to ReaderWriter locks etc.
TIA
Jason
Public Class MyMessageQueue
Dim synchQueue As Queue = Queue.Synchronized(New Queue)
Public Sub Add(ByVal strMessage As String)
synchQueue.Enqueue(strMessage)
End Sub
Public Function Remove() As String
Return synchQueue.Dequeue
End Function
Public Function Count() As Long
Return synchQueue.Count
End Function
End Class
Jason Guest
-
ASP IIS Request queue
We have recently found that our ASP application located on a virtual directory on IIS6 Windows Server 2003 is only processing one page at a time,... -
CFMX7 and JMS Msg Queue
I have a perl script that i need to run in a single threaded manner. the hardware it communicates with will not allow multithreading of anykind.... -
SMTP Queue.
G'day to all. Small problem (I think). Synopsis: 1) Win2K server with IIS and SMTP (BOX1), 2) Exchange 2K on seperate box (BOX2, 3) DNS... -
udp input queue
Hello I'm debugging an application than listens on an UDP (unprivileged) port and I'm suspecting a queue buildup at certain peak load times. I... -
Queue deapth in aix 5.2
Hi all, I have notice that the "Queue Deapth" parameter for disk drivers has "disappear" in AIX 5.2. Instead of it that' there is a new...



Reply With Quote

