Monday, December 01, 2008 Login    Register

 


  Search Blog  
  Blog Listing  
  Blog Archive  
Traffic Director 468x80
  Common MultiThreading Compiler Error  
Location: BlogsThe Mighty Blog    
Posted by: Will Strohl 4/14/2008
Here is something that was happening to me today when trying to spawn a new thread to perform some task...

To prefix this, we often run into instances in ASP.Net Programing, when we need to spawn a new thread to take care of some business while the original thread can continue serving the UI to the end user. 

This is normally not too complicated of a task, but when you don't use a specific methodology, some of its quirks or requirements can be forgotten.  For instance, I could not for the life of me get a new thread to compile.  I kept verifying with previously written code that I was doing it right.  And sure enough...  I was!  Yet I was still getting an error like this:

No accessible method '[METHODNAME]' matches the signature of delegate 'Delegate Sub ParameterizedThreadStart(obj As Object)'.

I kept pouring my eyes over the code.  Something MUST be different, but what?  Well, eventually, the train came tumbling in, and squished all of the blinding thoughts out and I was able to see clearly again.  I was calling a Function in the new thread statement, and not a Sub.  Duh!

Everything compiled and ran just fine after I changed the method to a Sub.

Strangely enough, I was not able to find any help when searching for it on Google.  All of the SERPs were for other situations where multithreading was not involved.

Copyright ©2008 Will Strohl
Permalink |  Trackback

Your name:
Title:
Comment:
Security Code
Enter the code shown above in the box below
Add Comment   Cancel 
© Copyright 2004-2008 by Will Strohl. All rights reserved.