471,092 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,092 software developers and data experts.

best use of vb.net and multithreading

Hi All,
I'm going to rewrite a VB6 app to VB.net and I need some pointers.
Basically this app spawns simultaneous,multiple, independant
ActiveX.exe 'workers' which query a SQL Server database and BCP a load
of data out.
Now, what is the best way to approach this in .Net? Can .Net give me a
better way of utilising the resources of the server? We're also getting
some new hardware, 2 CPU Xeon rig with HT (hyper threading). Are there
any techniques which I need to investigate? Any pointers or links to
web articles will be greatly appreciated.

Many thanks,
Pete
Newbie .Net Developer - Peterboro, UK

Apr 13 '06 #1
4 2528
Boo,

It seems that every new user from Net want to use multithreading. The best
approach trying to avoid it.

It is usefull in situations of slow multi serving dataproviders by instance
if you have *more* databaseservers in one application or *more* different
data giving webservices in one application. For by instance a disk it should
theoratical give more rumble of the diskheads.

Some people want to use it to keep the close button alive. Nobody has missed
that until now in my opinion, but you can use for that the backgroundworker
in version 2005.

Be aware that multithreading cost forever more processing time. You can win
with multithreading throughput time but be aware that it is not a kind of
optimistic multiprocessing. You have yourself to be sure, that you by
instance do not make it posssible, that a user starts working with the data,
while he has only the half what he needs to start.

(It has nothing to do with your processors by the way, there are enough
threads running in a modern windows OS to benefit from that). By instance a
ASPNET application is going already for every client in a seperate thread.

Some can have others ideas, this are mine.

I hope this gives you some ideas as well.

Cor

<bo*****@yahoo.co.uk> schreef in bericht
news:11**********************@t31g2000cwb.googlegr oups.com...
Hi All,
I'm going to rewrite a VB6 app to VB.net and I need some pointers.
Basically this app spawns simultaneous,multiple, independant
ActiveX.exe 'workers' which query a SQL Server database and BCP a load
of data out.
Now, what is the best way to approach this in .Net? Can .Net give me a
better way of utilising the resources of the server? We're also getting
some new hardware, 2 CPU Xeon rig with HT (hyper threading). Are there
any techniques which I need to investigate? Any pointers or links to
web articles will be greatly appreciated.

Many thanks,
Pete
Newbie .Net Developer - Peterboro, UK

Apr 13 '06 #2
My first move would be to look as how efficient loading is (SqlBulkCopy for
2.0, SqlXml for 1.1) that was really fast when I gave it a try.

Keep in mind that multithreading is a double edge sword i.e. if you are
willing to improve performance you have to think where real parallelism
could occur.

--
Patrice

<bo*****@yahoo.co.uk> a écrit dans le message de news:
11**********************@t31g2000cwb.googlegroups. com...
Hi All,
I'm going to rewrite a VB6 app to VB.net and I need some pointers.
Basically this app spawns simultaneous,multiple, independant
ActiveX.exe 'workers' which query a SQL Server database and BCP a load
of data out.
Now, what is the best way to approach this in .Net? Can .Net give me a
better way of utilising the resources of the server? We're also getting
some new hardware, 2 CPU Xeon rig with HT (hyper threading). Are there
any techniques which I need to investigate? Any pointers or links to
web articles will be greatly appreciated.

Many thanks,
Pete
Newbie .Net Developer - Peterboro, UK

Apr 13 '06 #3
<bo*****@yahoo.co.uk> schrieb:
I'm going to rewrite a VB6 app to VB.net and I need some pointers.
Basically this app spawns simultaneous,multiple, independant
ActiveX.exe 'workers' which query a SQL Server database and BCP a load
of data out.
Now, what is the best way to approach this in .Net? Can .Net give me a
better way of utilising the resources of the server? We're also getting
some new hardware, 2 CPU Xeon rig with HT (hyper threading). Are there
any techniques which I need to investigate? Any pointers or links to
web articles will be greatly appreciated.


Basically you can use the classes in the 'System.Threading' namespace such
as 'Thread' to spawn operations in separate threads. The 'Monitor' class
and the 'SyncLock' keyword provide synchronization mechanisms.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://classicvb.org/petition/>

Apr 13 '06 #4
Dear All,
Thanks for your replys so far.

I've had a look at SqlBulkCopy but and this early stage I can't see
that it can export data out to .bcp files. Can it do this or is it just
for inserting rows into databases?

Cheers,
Pete

Apr 13 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

47 posts views Thread by mihai | last post: by
5 posts views Thread by sarge | last post: by
9 posts views Thread by tommy | last post: by
2 posts views Thread by Federico Babelis | last post: by
2 posts views Thread by Rich | last post: by
55 posts views Thread by Sam | last post: by
5 posts views Thread by sandy82 | last post: by
2 posts views Thread by Pradnya Patil | last post: by
7 posts views Thread by Ray | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.