Free Scan: Update Your PC's Outdated Drivers to Optimize Performance
January 5th, 2007, 07:49 PM
|
#1 (permalink)
| | Member
Join Date: Oct 2003
Posts: 247
| any good stuff on threading
anyone have any good info / tutorial on asp.net threading?
I found stuff online but all the simple examples are causing errors.
Anyone have any simple examples they have created that they want to share? |
| |
January 8th, 2007, 02:28 PM
|
#2 (permalink)
| | Senior Member
Join Date: May 2003 Location: Aus, Gold Coast :)
Posts: 793
|
sorry for my ignorance but are u talking about creating programming threads? |
| |
January 8th, 2007, 10:22 PM
|
#3 (permalink)
| | Member
Join Date: Oct 2003
Posts: 247
|
i am talking about Imports System.Threading class for .net
every simple example i use causes error. Here is a simple example that results in an error
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Page.IsPostBack = False Then
Dim A As Thread = New Thread(AddressOf methodA)
A.Start()
Dim i As Int32
For i = 0 To 5000
Response.Write("<br>" & i)
Next
End If
End Sub
Public Sub methodA()
Dim i As Int32
For i = 0 To 1500
Response.Write("<br>" & i)
Next
End Sub |
| |
January 9th, 2007, 08:51 AM
|
#4 (permalink)
| | Senior Member
Join Date: May 2003 Location: Aus, Gold Coast :)
Posts: 793
|
yeah thats what i meant, though i have only used fork or CreateThread before, never used threading in .NET... what is the error u get? |
| |
January 9th, 2007, 09:16 AM
|
#5 (permalink)
| | Senior Member
Join Date: May 2003 Location: Aus, Gold Coast :)
Posts: 793
|
btw where do u close the handle to the thread? |
| |
January 9th, 2007, 01:47 PM
|
#6 (permalink)
| | Real gangstas sip on Yacc
Join Date: Oct 2001 Location: Suckas-ville
Posts: 4,540
|
1) Use CODE tags please.
2) What error is this throwing? Quote: |
btw where do u close the handle to the thread?
| While good practice, not necessary as it will get cleaned up on its own.
Jkrohn
__________________
Signatures blow hard
If your signature contains an ad of any kind, congratulations, you're on my ignore list.
|
| |
January 9th, 2007, 11:34 PM
|
#7 (permalink)
| | Member
Join Date: Oct 2003
Posts: 247
|
i think i might just spring for a book on this subject...
it works then doesnt work. The error message i get is the following:
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in Unknown Module.
Additional information: Index and count must refer to a location within the buffer.
the other error message i get is (get one of the 2 error messages each time i run it:
An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in Unknown Module.
Additional information: Count cannot be less than zero. |
| |
January 10th, 2007, 02:26 AM
|
#8 (permalink)
| | Real gangstas sip on Yacc
Join Date: Oct 2001 Location: Suckas-ville
Posts: 4,540
|
Don't use i in both functions. Use a different variable name. It shouldn't matter but vb.net is completely braindead.
Also put in some error handling and see if you can catch the exception when it happens so you can print some better debug.
I've use threading extensively but only in exe's and only in C#. You couldn't pay me enough to use VB.Net.
Jkrohn |
| |
January 10th, 2007, 02:42 PM
|
#9 (permalink)
| | Member
Join Date: Oct 2003
Posts: 247
|
i will try that wheni get home. I also get once in a while the following error message.
An unhandled exception of type 'System.Runtime.Serialization.SerializationExcepti on' occurred in Unknown Module.
Additional information: The type System.Web.HttpException in Assembly System.Web, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a is not marked as serializable.
Any idea what might be causing that? |
| | |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | | |
Posting Rules
| You may post new threads You may post replies You may not post attachments You may not edit your posts HTML code is Off | | | | Most Active Discussions | | | | | Recent Discussions  | | | | | |