R
rakesh_nits
Hi All,
I am having a function which can be called from different independent
threads
simultaneously.Inside this i am having a hashtable.what each thread
will do that it will check whether the hashtable contains a particular
key if not then it will make an entry in the hashtable with that key or
if it exists it will simply use the value corresponding to that
particular key.what i want that the access to the function should be on
first come first serve basis.so if a thread is already waiting on the
function the current thread after completing processing should leave it
(should enter in succession only if there is not any waiting thread),
and no thread should be kept waiting for infinite.so entry into the
function should be related to time of waiting in short i want the
impementation to be a queue like.is using lock(object) will be suffice
for the task or i have to use something else.What is the best way to
accomlish this?. and also if you can tell me how this lock statement
functions.whether it will cause the other statement to wait or simply
not allow the other threads to access it and throw some error.Thanks in
Advance.
Rakesh
I am having a function which can be called from different independent
threads
simultaneously.Inside this i am having a hashtable.what each thread
will do that it will check whether the hashtable contains a particular
key if not then it will make an entry in the hashtable with that key or
if it exists it will simply use the value corresponding to that
particular key.what i want that the access to the function should be on
first come first serve basis.so if a thread is already waiting on the
function the current thread after completing processing should leave it
(should enter in succession only if there is not any waiting thread),
and no thread should be kept waiting for infinite.so entry into the
function should be related to time of waiting in short i want the
impementation to be a queue like.is using lock(object) will be suffice
for the task or i have to use something else.What is the best way to
accomlish this?. and also if you can tell me how this lock statement
functions.whether it will cause the other statement to wait or simply
not allow the other threads to access it and throw some error.Thanks in
Advance.
Rakesh