473,387 Members | 1,545 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

synclock on queue properties?

Is it necessary to do a synclock when checking the message count of a
shared queue object?
Nov 20 '05 #1
4 1274
It's read only, so you shouldn't have to.

--
Brian M. Reisman
MCAD, MCDBA, MCSD,
MCSE, MCT, OCA, NET+
My Book @ Amazon: http://www.amazon.com/exec/obidos/tg...l/-/0782141617

"Keith Langer" <ta******@aol.com> wrote in message
news:15*************************@posting.google.co m...
Is it necessary to do a synclock when checking the message count of a
shared queue object?

Nov 20 '05 #2
Keith,
I think it really depends on how the Count Property it implemented. If the
queue has a underlying backing field for the count that the Count Property
returns, then I would say yes. However if the queue physically counts the
items, then I would say no.

However as Brian stated, I don't think you should have to.

Hope this helps
Jay

"Keith Langer" <ta******@aol.com> wrote in message
news:15*************************@posting.google.co m...
Is it necessary to do a synclock when checking the message count of a
shared queue object?

Nov 20 '05 #3
According to the help files ALL OPERATIONS on a Queue should be synchronized.
"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message news:<uX**************@tk2msftngp13.phx.gbl>...
Keith,
I think it really depends on how the Count Property it implemented. If the
queue has a underlying backing field for the count that the Count Property
returns, then I would say yes. However if the queue physically counts the
items, then I would say no.

However as Brian stated, I don't think you should have to.

Hope this helps
Jay

"Keith Langer" <ta******@aol.com> wrote in message
news:15*************************@posting.google.co m...
Is it necessary to do a synclock when checking the message count of a
shared queue object?

Nov 20 '05 #4
Jim,
I hope you realize my statement was for properties in general and not the
Queue property specifically!

Thank you for pointing that out!

Jay

"Jim Shoo" <fr********@yahoo.com> wrote in message
news:65*************************@posting.google.co m...
According to the help files ALL OPERATIONS on a Queue should be synchronized.

"Jay B. Harlow [MVP - Outlook]" <Ja************@msn.com> wrote in message

news:<uX**************@tk2msftngp13.phx.gbl>...
Keith,
I think it really depends on how the Count Property it implemented. If the queue has a underlying backing field for the count that the Count Property returns, then I would say yes. However if the queue physically counts the items, then I would say no.

However as Brian stated, I don't think you should have to.

Hope this helps
Jay

"Keith Langer" <ta******@aol.com> wrote in message
news:15*************************@posting.google.co m...
Is it necessary to do a synclock when checking the message count of a
shared queue object?

Nov 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Keith Langer | last post by:
I have some questions about whether synclock is necessary in a few different scenarios: 1) I have a Queue class which is shared between two threads. Thread 1 pushes objects onto the queue and...
4
by: fred | last post by:
If I have multiple threads running a Sub as below then a number of threads can be held up at the SyncLock. When it becomes free which thread goes first. Is it just by chance which thread goes first...
10
by: Bob Day | last post by:
Using vs 2003, vb.net sql msde.. Consider the following code snippets. See **** for questions. All are shared and accessed by multiple threads simultaneiously. ' Instantiate per for this...
4
by: Jeff Stewart | last post by:
Specifically, I don't understand the parameter that Synclock accepts. How is a reference type a lockable entity? What -is- a reference type? Is it a number? Is it a value at a specific memory...
1
by: fred | last post by:
I have a VB application that is using MS Access as its database. To avoid connection delays the application creates one connection to the database at start-up and maintains that single connection...
7
by: Chris Dunaway | last post by:
Suppose I have several threads that need to access the same object. ThreadA successfully acquires the lock using SyncLock. ThreadB attempts to acquire the lock and blocks and then ThreadC attempts...
3
by: Chris Dunaway | last post by:
I was using a Queue object like this to create my own specialized queue class for use with my own objects: Public Class MySpecializedQueue Private q As New Queue Public Sub Enqueue(obj As...
1
by: Perecli Manole | last post by:
Can an Exit Sub statement in a SyncLock block cause any problems with the proper release of the locked resource or affect the Monitor's waiting queue in any way? Thanks Perry
2
by: cj | last post by:
I take it a mutex is like a synclock but visible outside the program?
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.