473,785 Members | 3,245 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Regarding manualResetEven ts

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(t ransferEvent.DA TAAVAIL) = New
ManauaResetvent (false)
transferEvent(t ransferEvent.ST OP) = New ManauaResetvent (false)
'pause the transfer
transferEvent(t ransferEvent.TE RMINATE) = 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(t ransferEvent.DA TAAVAIL).reset( )
transferEvent(t ransferEvent.ST OP).set()
'else
transferEvent(t ransferEvent.ST OP).set()
End Function
Public Function DataAvailable()
'check for wheter set event is stop if yes then
transferEvent(t ransferEvent.ST OP).reset()
transferEvent(t ransferEvent.DA TAAVAIL).set()
'else
transferEvent(t ransferEvent.DA TAAVAIL).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 ManualResetEven t()
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 956

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

Similar topics

4
1819
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. I have looked for a python web framework to build a web site, a site that I had start in php (and quite finish), but for some reason I wont explain, I lost everything. I have started writting app with python 6
3
1777
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 regarding this so If anyone know regarding this. Kindly mail me as early as possible with regards
3
2214
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 myErrorHandler
7
2458
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 *(MyArray+x), what statement is functionally identical to MyArray? I ask this question because when I create a dynamic array with one
8
5266
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 developing a web-based application, one part of which involves allowing the user the ability to page through transaction "history" information. The _summary_ history table will have the following fields: ServiceName, Date, User-Ref1, User-Ref2,...
2
1630
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 command to close out the other session?
5
1800
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 false as i want to start processing only on user specified time. I am setting interval as difference between user sepcified time and current time. And when that elapsed event occured i am again setting
1
1527
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 enables staff to "browse" by product, which will list all products that begin with the letter they had chosen. On the return of this, i had previously used the results to form a
1
1750
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 modules. The modules have been duplicated and thus the need to change the serial number on each one. My approach is to use a USB to IDE adapter cable and write a C# routine which will automate the writing of the serial #. At this point, I have a...
0
9645
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10091
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6740
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5381
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2879
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.