Fetstil Fetstil Kursiv Understrykning linje färgläggning tabellverk Punktlista Nummerlista Vänster Centrerat högerställt Utfyllt Länk Bild htmlmode
  • Forum & Blog
    • Forum - översikt
      • .Net
        • asp.net generellt
        • c#
        • vb.net
        • f#
        • silverlight
        • microsoft surface
        • visual studio .net
      • databaser
        • sql-server
        • databaser
        • access
        • mysql
      • mjukvara klient
        • datorer och komponenter
        • nätverk, lan/wan
        • operativsystem
        • programvaror
        • säkerhet, inställningar
        • windows server
        • allmänt
        • crystal reports
        • exchange/outlook
        • microsoft office
      • mjukvara server
        • active directory
        • biztalk
        • exchange
        • linux
        • sharepoint
        • webbservers
        • sql server
      • appar (win/mobil)
      • programspråk
        • c++
        • delphi
        • java
        • quick basic
        • visual basic
      • scripting
        • asp 3.0
        • flash actionscript
        • html css
        • javascript
        • php
        • regular expresssion
        • xml
      • spel och grafik
        • DirectX
        • Spel och grafik
      • ledning
        • Arkitektur
        • Systemutveckling
        • krav och test
        • projektledning
        • ledningsfrågor
      • vb-sektioner
        • activeX
        • windows api
        • elektronik
        • internet
        • komponenter
        • nätverk
        • operativsystem
      • övriga forum
        • arbete karriär
        • erbjuda uppdrag och tjänster
        • juridiska frågor
        • köp och sälj
        • matematik och fysik
        • intern information
        • skrivklåda
        • webb-operatörer
    • Posta inlägg i forumet
    • Chatta med andra
  • Konto
    • Medlemssida
    • Byta lösenord
    • Bli bonsumedlem
    • iMail
  • Material
    • Tips & tricks
    • Artiklar
    • Programarkiv
  • JOBB
  • Student
    • Studentlicenser
  • KONTAKT
    • Om pellesoft
    • Grundare
    • Kontakta oss
    • Annonsering
    • Partners
    • Felanmälan
  • Logga in

Hem / Forum översikt / inlägg

Posta nytt inlägg


Threading - how to end a process

Postades av 2004-01-20 15:46:27 - paul horsley, i forum vb.net, Tråden har 2 Kommentarer och lästs av 751 personer

Dear All,
Dreading threading...

I want to make a vb.net exe that can handle different processing of files.
Example...
<info>
For this example we can say 3 Processes need to be continuosly done on 3 different set of files ( all files are comming to my server via ftp), but the amount of different processes is not a static value ie some weeks/days I might need to do 50 processes )

process 1 - any files found in folder 1 should be at given intervals grouped into one file and the output written to folder 2
Cycle time = 30 secounds

process 2 - any files found in folder 3 should be at given intervals grouped into one file and the output written to folder 4
Cycle time = 1 minute

process 3 - any files found in folder 5 should process to create one file for every line ( record ) found in the file(s) found and the output file(s) written to folder 6
Cycle time = 3 minutes
</info>

With this in mind I have so far created a windows exe that reads the required count of active processes to be run at start up from a table. The exe then reads per active process id a list of run time values found in a table matching the processid ( this all works fine ( using sql db as data base)). For each required process the exe start craetes a new class (a base class) that uses system.timers.timer object, the new class is started on it's own thread.

I can see so far everything is ok. but now I need to be able to from the exe main form be able to close / kill / stop the thread if a user decides to stop a certain process. All events are logged to the sql db under a logging class on it's own thread as well, so I'm also wondering, how would I be able to from a web page also stop the process thread cleanly.

In both instances of stopping the process I would like to check first if the process was busy formating files, if it was then I would like to be able to set a value so that the next time the timer elapses it checks to see if it should process or not.

The reason I wanted to use this threading technique is so that the exe just acts as a broker of the required processes. Also to note this application will be ported to Citrix so if any body sees any pit falls of the solution I would like them to say so.

?Should I just create x number of timers and have a single threaded solution? Any help very apprieciated as normal

Regards Paul


Svara

Sv: Threading - how to end a process

Postades av 2004-01-20 17:17:18 - Fredrik Normén

Hi Paul,

Take a look at this site:

http://docs.msdnaa.net/ark_new3.0/cd3/content/Type_Sample%20Applications.htm#title5_13

/Fredrik Normén NSQUARED2


Svara

Sv: Threading - how to end a process

Postades av 2004-01-21 09:08:47 - paul horsley

Fredrik,
Thanks for site, I looked at the sample 'Killing a thread' only thins is it was in C# and my sytax and knowledge of the language is limited, you do not know of any VB.samples anywhere do you?

regards Paul


Svara

Nyligen

  • 19:55 kick-off med fokus på hälsa?
  • 19:53 kick-off med fokus på hälsa?
  • 16:24 Föreslå en skönhetsklinik online
  • 16:23 Föreslå en skönhetsklinik online
  • 18:42 Hvor finder man håndlavede lamper
  • 18:41 Hvor finder man håndlavede lamper
  • 16:36 Allt du behöver veta om keramiskt
  • 16:14 Vem anlitar man egentligen när tak

Sidor

  • Hem
  • Bli bonusmedlem
  • Läs artiklar
  • Chatta med andra
  • Sök och erbjud jobb
  • Kontakta oss
  • Studentlicenser
  • Skriv en artikel

Statistik

Antal besökare:
Antal medlemmar:
Antal inlägg:
Online:
På chatten:
4 570 719
27 958
271 751
5 954
0

Kontakta oss

Frågor runt konsultation, rådgivning, uppdrag, rekrytering, annonsering och övriga ärenden. Ring: 0730-88 22 24 | pelle@pellesoft.se

© 1986-2013 PelleSoft AB. Last Build 4.1.7169.18070 (2019-08-18 10:02:21) 4.0.30319.42000
  • Om
  • Kontakta
  • Regler
  • Cookies