473,769 Members | 3,232 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 955

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
5264
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
1526
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
1747
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
9590
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
10223
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...
0
10051
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7413
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6675
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
5310
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
5448
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3968
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3571
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.