Click here to Skip to main content
15,881,413 members

d_smit - Professional Profile



Summary

    Blog RSS
4
Debator
20
Enquirer
168
Participant
0
Author
0
Authority
0
Editor
0
Organiser
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Reputation

Weekly Data. Recent events may not appear immediately. For information on Reputation please see the FAQ.

Privileges

Members need to achieve at least one of the given member levels in the given reputation categories in order to perform a given action. For example, to store personal files in your account area you will need to achieve Platinum level in either the Author or Authority category. The "If Owner" column means that owners of an item automatically have the privilege. The member types column lists member types who gain the privilege regardless of their reputation level.

ActionAuthorAuthorityDebatorEditorEnquirerOrganiserParticipantIf OwnerMember Types
Have no restrictions on voting frequencysilversilversilversilver
Bypass spam checks when posting contentsilversilversilversilversilversilvergoldSubEditor, Mentor, Protector, Editor
Store personal files in your account areaplatinumplatinumSubEditor, Editor
Have live hyperlinks in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Have the ability to include a biography in your profilebronzebronzebronzebronzebronzebronzesilverSubEditor, Protector, Editor
Edit a Question in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Edit an Answer in Q&AsilversilversilversilverYesSubEditor, Protector, Editor
Delete a Question in Q&AYesSubEditor, Protector, Editor
Delete an Answer in Q&AYesSubEditor, Protector, Editor
Report an ArticlesilversilversilversilverSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending ArticlegoldgoldgoldgoldSubEditor, Mentor, Protector, Editor
Edit other members' articlesSubEditor, Protector, Editor
Create an article without requiring moderationplatinumSubEditor, Mentor, Protector, Editor
Approve/Disapprove a pending QuestionProtector
Approve/Disapprove a pending AnswerProtector
Report a forum messagesilversilverbronzeProtector, Editor
Approve/Disapprove a pending Forum MessageProtector
Have the ability to send direct emails to members in the forumsProtector
Create a new tagsilversilversilversilver
Modify a tagsilversilversilversilver

Actions with a green tick can be performed by this member.


 
Questioncreating threads for parametrised methods Pin
d_smit12-Apr-08 1:24
d_smit12-Apr-08 1:24 
Hello,
I have a query related to multithreading.
I developed an application in vb.net 2005.
In this application i am calling some method in my code for every user
suppose for 50 users. but it will become slow if user increases.
so, i need to define threads which will handle task for particular number of users.
I have written the following code
'Delegate to parametrised method
delegate sub TaskMethod(byref o as object)
'In another method for particular users creating thread and calling method as
for i=0 to 10 'say 10 users and next will begin from 11 to another 10 like so
dim delobj as taskmethod= addressof Mymethod
next
'Implement mymethod
sub mymethod(byref o as object)
'task to do write here
end sub

problem i am facing is that all threads are using same resource( i mean connection to database here). so not executing properly. And i need to synchronised tthe threads.So defined the threadpool as
' replace delobj statement with
threadpool.<placing in="" queueevent="">(new waitcallback(addressof mymethod)

all other similar ways also tried but getting error in mymethod(as underlined by blue line)
i am stuck to it and not getting wheres the error lies.
So, anyone who knows please correct it and tell how to call a parametrised method inside some other method using synchronised threads.

Any help will be highly appreciated.
Thanks.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.