Results 1 to 3 of 3

Thread: app terminates after a few mins

  1. #1

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428

    app terminates after a few mins

    I'm using this code to make my processor usage go to 100% (testing something with CPU temp)... the code is random, doesn't make sense anyways, I'm just including it for reference:
    VB Code:
    1. Imports System.Threading
    2. Module Module1
    3.     Sub main()
    4.         Dim t1, t2 As Thread
    5.         t1 = New Thread(AddressOf foo)
    6.         t2 = New Thread(AddressOf foo)
    7.         t1.Start()
    8.         t2.Start()
    9.     End Sub
    10.  
    11.     Sub foo()
    12.         Dim i As Integer
    13.         Dim b As Double
    14.  
    15.         Do
    16.             For i = 0 To Integer.MaxValue
    17.                 b = (i ^ 2) - i
    18.             Next
    19.         Loop
    20.     End Sub
    21. End Module

    I have a p4, 3ghz hyperthreaded, 1gb ram.... I run this and after about 7 mins the program just shuts down without any messages or anything showing up. It just dissapears from task manager. This is a bit abnormal to me and I was just wondering if you've seen something like this happen. I'm running this on winXP btw....
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

  2. #2
    yay gay PT Exorcist's Avatar
    Join Date
    Apr 2002
    Location
    . . . my reason of shame
    Posts
    2,729
    maybe it's because b get's a value that's just too high and an error is thrown? When you're using multi threads this kind of exceptions many of the times aren't thrown up but they still ocurr.
    \m/\m/

  3. #3

    Thread Starter
    l33t! MrPolite's Avatar
    Join Date
    Sep 2001
    Posts
    4,428
    Originally posted by PT Exorcist
    maybe it's because b get's a value that's just too high and an error is thrown? When you're using multi threads this kind of exceptions many of the times aren't thrown up but they still ocurr.
    hmm so that has to do with multithreading?
    is this something official that multithreaded apps dont throw all the errors? cuz it doesnt make sense to me
    rate my posts if they help ya!
    Extract thumbnail without reading the whole image file: (C# - VB)
    Apply texture to bitmaps: (C# - VB)
    Extended console library: (VB)
    Save JPEG with a certain quality (image compression): (C# - VB )
    VB.NET to C# conversion tips!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width