Multithreading
-
Multithreading will not actually make your application perform multiple updates at the same time. Instead it will just have the one thread perform one, then the second one, then the third one, then the first one again, etc. It will be much faster doing the whole thing with SQL. You wouldn't even need an application at all, just a stored procedure or an SQL job.
My advice is free, and you may get what you paid for.
I think you do not understand the problems exactly. I ahve lots of email addresses in my database . and a single query take a lot of time of its execution. so in this satuation it will happns that may the whole prrocess take few days in completing which is not useful for me. thnks! with best wishes!!!!!
-
Hi, I am Working on the VB.Net to perform a Multithreading to correct the invalid email addresses in Database. The problem is that I have 22,00,00,000 email addresses. So I want, Multiple threads do work on this process . I am Little bit confusion about how to create more threads and all the threads can work togather but not access the same IDs of Email Address from table . For doing this I ahve created a list box , in which I devided the IDs of email Addressses into many list items . I want that first thread do work on first list item , Second created thread do work on second list item and so on. But the problem is that when i created multithreading some list of item is missing and the threads cannot do work on some list of items. With Regards,
-
I think you do not understand the problems exactly. I ahve lots of email addresses in my database . and a single query take a lot of time of its execution. so in this satuation it will happns that may the whole prrocess take few days in completing which is not useful for me. thnks! with best wishes!!!!!
I do understand what you mean. What I am trying to say, is that any application using threading, you write, will always use the capacity of your PC or server in a less efficient way than the database server program would. Again, multithreading in principle does not make the computer perform multiple actions at the same time. It only makes the computer perform these actions in rapid succession, so it looks like it is doing things at the same time. Your database server program however can and will (usually) readily use multicore CPU's or servers with multiple CPU's. So it will actually make your PC or server perform multiple actions at the same time. If you need to sort through that much data, you are going to have to be prepared for a lengthy process, although I seriously doubt it would take days. Hours maybe. So it would be best if you create one additional field in your table, where you can flag each email address when it has been checked. That way you can write your SQL so that it only checks unflagged addresses, and your sql job or stored procedure will only have to run for a long time the first time.
My advice is free, and you may get what you paid for.
-
I think you do not understand the problems exactly. I ahve lots of email addresses in my database . and a single query take a lot of time of its execution. so in this satuation it will happns that may the whole prrocess take few days in completing which is not useful for me. thnks! with best wishes!!!!!
But, as Johan quite rightly said, 2 threads wont perform the process twice as quick as 1 thread. Threading just means that you can have more than 1 process running independently of each other, but they still have to share processor time. EDIT : Actually, I could be wrong here, maybe multi-core processors can run threads concurrently? Maybe someone can shed a light on this?
modified on Friday, April 17, 2009 8:15 AM
-
But, as Johan quite rightly said, 2 threads wont perform the process twice as quick as 1 thread. Threading just means that you can have more than 1 process running independently of each other, but they still have to share processor time. EDIT : Actually, I could be wrong here, maybe multi-core processors can run threads concurrently? Maybe someone can shed a light on this?
modified on Friday, April 17, 2009 8:15 AM
Liqz wrote:
Actually, I could be wrong here, maybe multi-core processors can run threads concurrently?
If they couldn't, what would be the point of multiple cores??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Liqz wrote:
Actually, I could be wrong here, maybe multi-core processors can run threads concurrently?
If they couldn't, what would be the point of multiple cores??
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008I realise that processes can be run concurrently using multi-core processors but wasn't sure about threads. Anyway, thanks for correcting my mistake :)
-
I think you do not understand the problems exactly. I ahve lots of email addresses in my database . and a single query take a lot of time of its execution. so in this satuation it will happns that may the whole prrocess take few days in completing which is not useful for me. thnks! with best wishes!!!!!
You're not getting it. The SQL Server is a better place to do this. You won't be wasting a ton of time transferring that much data TWICE acrossed the network to the PC doing the processing, plus, multi-threading will only buy you a performance benefit if the PC has multiple processors, or multiple cores. You can't start, say, 10 threads on a single core machine and expect it to go 10 times faster. It doesn't work that way. Starting more threads to process data than there are cores in the machine is a complete waste of time. In a single core machine, the processor can only execute one thread at a time, pausing all other threads until it can get around to each of them.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
I realise that processes can be run concurrently using multi-core processors but wasn't sure about threads. Anyway, thanks for correcting my mistake :)
Processors don't execute processes, they execute threads. A process is an operating system concept, not a processor concept. A process is just an organized collection of threads.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008 -
Processors don't execute processes, they execute threads. A process is an operating system concept, not a processor concept. A process is just an organized collection of threads.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008Ah I see, thanks again :)
-
220 MILLION or 22 BILLION? Thats a lot of email addresses. Sort of like a list a spammer would have. Either way, its going to take a LONG time to process that lot.
Given either number, I'm not helping this goof ball send spam. I purging my hotmail acct now - what a pain in the butt.
Any suggestions, ideas, or 'constructive criticism' are always welcome. "There's no such thing as a stupid question, only stupid people." - Mr. Garrison