473,386 Members | 1,812 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,386 software developers and data experts.

Regarding manualResetEvents

Hi all,

I have a problem regarding use of manualreset events in .net.
I have a developed a sample appliation in which entries from the
listview which I say is a queue for my processes.I want to schedule
these processes in my queue.
I also want to stop the processing by selcting the pause so that the
scheduling stops and again if i say add schedule the schedule should
start again.I have used manual reset events to control the
communication between scheduling. Bcz msdn says we can't have control
on autoreset events.
Remember I have used only one thread which is managing the entire
processing.

The sample code which i have tried is -

Class transferManager

Public Function New()
transferEvent(transferEvent.DATAAVAIL) = New
ManauaResetvent(false)
transferEvent(transferEvent.STOP) = New ManauaResetvent(false)
'pause the transfer
transferEvent(transferEvent.TERMINATE) = New
ManauaResetvent(false)
End Function

Public Function Start(Byval lvw as listview)
tranfermanager = lvw
transferThread.start()
End Function
Public Function Stop()
'check for wheter set event is data avail if yes then
transferEvent(transferEvent.DATAAVAIL).reset()
transferEvent(transferEvent.STOP).set()
'else
transferEvent(transferEvent.STOP).set()
End Function
Public Function DataAvailable()
'check for wheter set event is stop if yes then
transferEvent(transferEvent.STOP).reset()
transferEvent(transferEvent.DATAAVAIL).set()
'else
transferEvent(transferEvent.DATAAVAIL).set()
End Function
Public Function TransferEngine() 'thread proc associated with the
thread
Do while
'if any of the stop or terminate set then return
Do while tranfermanager.items.count <> 0
transfer( tranfermanager.items(0)) 'start process
end while
end while

End Function

Private transferEvent(2) as ManualResetEvent()
Private transferThread as new thread(false)
Private tranfermanager as new listview

End Class

SO my exact problem is i say "add schedule" the process is added and
call to DataAvailable() is given so that the scheduling is started .
But in between if i say stop the schudule is stoopped by calling
Stop(). Now if i again say add shedule call to DataAvailable()
doesn't start the thread again it is in 'stopped' state what could be
the reason. Any ideas.
That means somehow my Threadproc is not executing again after pause
Sample application would also do.

Thanks in advance

Dec 25 '05 #1
0 935

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

Similar topics

4
by: Francis Lavoie | last post by:
Hello I have some questions regarding webframework, I must say that I quite lost and these questions are basicly to help me understand the way it work. I have some knowledge with PHP and JSP....
3
by: praba kar | last post by:
Dear All, I am new to Python. I am in need of some sorting functions (eg) numerical sorting functions and alphapetical sorting functions. I have searched through net But I cannot find any...
3
by: Samuel | last post by:
I wrote a very simple httpmodule and tried to compile it with no success. This is my code: ============== Imports System Imports System.Web Imports Microsoft.VisualBasic NameSpace...
7
by: Squignibbler | last post by:
Hi all, I have a question regarding the C++ programming language regarding the nature of the relationship between pointers and arrays. If the statement MyArray is functionally identical to...
8
by: Mike | last post by:
Hello, I have a few rather urgent questions that I hope someone can help with (I need to figure this out prior to a meeting tomorrow.) First, a bit of background: The company I work for is...
2
by: Dean R. Henderson | last post by:
For an ASP.NET web application, is there a way for one session (with appropriate security authorization) to set a HttpSessionState variable to point to another session and execute the Abandon...
5
by: archana | last post by:
Hi all, I am using timer to do some functionality on user specified time. I am using system.timers.timer class and its timer to do this functionality. What i am doing is i set autoreset to...
1
by: Dave | last post by:
Hi guys, i have a small question regarding register_globals I have managed to change the way my forms work so they will process with register_globals turned off. However i have one page which...
1
by: Jim Flanagan | last post by:
Hello - I am in need of more help regarding an approach to accomplishing the following: We have a need to change the Volume serial numbers of a bunch of preprogrammed IDE Solid State Drive...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.