home hardware prices news articles forums photos user reviews
Go Back   Tech Support Forums - TechIMO.com > PC Hardware and Tech > Webmastering and Programming
Join TechIMO for Free!
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read
Reply Get bargains at  »  Dealighted.com
 
Thread Tools
Currently Active Users: 2696
Discussions: 186,606, Posts: 2,227,046, Members: 230,240
Free Scan: Update Your PC's Outdated Drivers to Optimize Performance
Old January 5th, 2007, 07:49 PM   Digg it!   #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?

amtrac24 is offline   Reply With Quote
TechIMO.com Ads - Login or register for less ads.
How many errors does your computer have?

You no longer need to guess! This free stability scan and registry cleaner download will give you a complete diagnosis of your Windows registry, identifying errors and conflicts.

FREE instant scan


Guest, Register Free! to remove this ad and get your tech support questions answered in minutes!
Old January 8th, 2007, 02:28 PM     #2 (permalink)
Senior Member
 
Join Date: May 2003
Location: Aus, Gold Coast :)
Posts: 793
Send a message via ICQ to exally
sorry for my ignorance but are u talking about creating programming threads?

exally is offline   Reply With Quote
Old January 8th, 2007, 10:22 PM     #3 (permalink)
Member
 
Join Date: Oct 2003
Posts: 247
threading

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

amtrac24 is offline   Reply With Quote
Old January 9th, 2007, 08:51 AM     #4 (permalink)
Senior Member
 
Join Date: May 2003
Location: Aus, Gold Coast :)
Posts: 793
Send a message via ICQ to exally
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?
exally is offline   Reply With Quote
Old January 9th, 2007, 09:16 AM     #5 (permalink)
Senior Member
 
Join Date: May 2003
Location: Aus, Gold Coast :)
Posts: 793
Send a message via ICQ to exally
btw where do u close the handle to the thread?
exally is offline   Reply With Quote
Old January 9th, 2007, 01:47 PM     #6 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,540
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
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.
jkrohn is online now   Reply With Quote
Old January 9th, 2007, 11:34 PM     #7 (permalink)
Member
 
Join Date: Oct 2003
Posts: 247
hey

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.
amtrac24 is offline   Reply With Quote
Old January 10th, 2007, 02:26 AM     #8 (permalink)
Real gangstas sip on Yacc
 
jkrohn's Avatar
 
Join Date: Oct 2001
Location: Suckas-ville
Posts: 4,540
Send a message via ICQ to jkrohn Send a message via AIM to jkrohn Send a message via Yahoo to jkrohn
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
jkrohn is online now   Reply With Quote
Old 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?
amtrac24 is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may post new threads
You may post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Mono: Good stuff jkrohn Webmastering and Programming 1 February 18th, 2006 12:44 AM
new stuff? good stuff? work together? butch81385 General Tech Discussion 43 December 7th, 2004 03:17 AM
Lots of good stuff for sale! RAR Traders Forum: Buy, Sell, Trade 59 December 21st, 2003 11:46 PM
F/S or F/T: PC3200 Memory (Good Stuff)! radio1_mike Traders Forum: Buy, Sell, Trade 7 October 27th, 2003 07:53 AM
This stuff is GOOD!! Ritalin Kid IMO Community 19 March 13th, 2002 11:18 PM

Most Active Discussions
Is It Just Me? (527)
Misery Loves Company... (1849)
Why Does the MOON Grow Bigger as It.. (18)
heatsink issue (10)
New Mobo (18)
UPGRADING C/D DRIVE TO 250GB & .. (14)
SSD's, RAID, and External Backup (7)
1 internet. 1 house. 3 computer. ho.. (13)
Is This A Compatible Gaming PC? (18)
Recent Discussions
firewall (1)
C++ compiler suggestions (4)
Official World of Warcraft Thre.. (4529)
Programming question (2)
UPGRADING C/D DRIVE TO 250GB &a.. (14)
Ubuntu or Xubuntu....anyone!!? (7)
Building my first PC and need s.. (0)
PNY vs Gainward (3)
Linksys WRT54G (2)
FS: Dell 6000 laptop, modded 36.. (2)
Apple iPod touch 16 GB $200 (4)
Six 28-Disc Cross Design Black .. (4)


All times are GMT -4. The time now is 11:50 AM.
TechIMO Copyright 2008 All Enthusiast, Inc.



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28