Will adding some thread control fix this problem?

Discussion in 'ASP .Net' started by Rob Meade, Apr 27, 2004.

  1. Rob Meade

    Rob Meade Guest

    Hi all,

    For an indepth summary of whats going on please see my other topic entitled
    "Curious Problem" dated 25/04/2004

    Anyway, that aside...

    I have some code was failing to do what I wanted...I've dropped this around
    the sub that I was calling (which never seemed to get fired)..

    Try
    parseEmail(filePath)
    Catch ex As Exception
    evtLog.Source = "ScanFolder"
    evtLog.Log = "ScanFolder"
    evtLog.WriteEntry("ScanFolder", ex.Message,
    EventLogEntryType.Information)
    End Try

    Ok - so first time after starting the service things are fine - second time
    the parseEmail sub doesn't run and the exception is caught writing this to
    my event log:

    Event Type: Information
    Event Source: ScanFolder
    Event Category: None
    Event ID: 0
    Date: 27/04/2004
    Time: 18:33:13
    User: N/A
    Computer: TITUS
    Description:
    The process cannot access the file
    "C:\Inetpub\mailroot\mailbox\kingswoodwebservices.co.uk\P3_Support.mbx\p3_20
    04042718331307670000001b.eml" because it is being used by another process.

    For more information, see Help and Support Center at
    http://go.microsoft.com/fwlink/events.asp.


    Ok - so its being used by another process - I can only assume my on service
    etc (that this code is from)...

    Therefore, based on a suggestion in my other topic I have looked at the
    thread code...saw this:

    Dim Thread1 As New System.Threading.Thread(AddressOf sometask)
    Thread1.Start()

    Figured I also needed Thread1.Join() etc - but that aside I seem to be a bit
    lost with the replacement of the 'sometask' bit - I assumed this would be my
    sub - ie, parseEmail - tried that get the following error:

    Method 'Private Sub parseEmail(path As String)' does not have the same
    signature as delegate 'Delegate Sub ThreadStart()'.

    Now that means nothing to me at all :eek:/

    I think I would probably want my entire code in a thread to be honest, so
    would probably need to start the threading at the top of the code
    entirely...

    Any help / assistance with this would be gratefully received.

    Best regards

    Rob
     
    Rob Meade, Apr 27, 2004
    #1
    1. Advertising

  2. Rob Meade

    Rob Meade Guest

    > Ok - so first time after starting the service things are fine - second
    time
    > the parseEmail sub doesn't run and the exception is caught writing this to
    > my event log:


    actually not entirely correct - it seems that this fails on the first
    iteration also...

    Wondering now actually if the fact that its a 'mailbox' directory is that
    cause?

    Again - any info appreciated,

    Rob
     
    Rob Meade, Apr 27, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Patrick Philippot
    Replies:
    0
    Views:
    490
    Patrick Philippot
    Apr 14, 2006
  2. Xah Lee
    Replies:
    22
    Views:
    1,184
    Tim Roberts
    Mar 21, 2006
  3. Xah Lee
    Replies:
    23
    Views:
    1,129
    Tim Roberts
    Mar 21, 2006
  4. bearsprite
    Replies:
    3
    Views:
    611
    Dennis Lee Bieber
    Dec 12, 2006
  5. Xah Lee
    Replies:
    21
    Views:
    849
    Tim Roberts
    Mar 21, 2006
Loading...

Share This Page