473,385 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

Multithreading for long running task

Hello All,

I am developing a file uploading sever. I am planning to create this as a
multithreaded application in which every file upload request will be done
through a separate thread from the thread pool. While going through some
articles on the internet, I came to know that it is a bad practice to
allocate thread from thread pool for long running application.

I would like to know what other alternatives are available in the threading
context, so that I can delegate the task of uploading files to different
threads for files which are very large in size.

Thanks
pradeep_tp
Mar 15 '07 #1
3 2089
VJ
really? can I see the article. All I have seen is thread pool is the best
practice...

Ok what we do is we use BITS, do large file transfers, but that ofcourse
eliminates FTP. We ran this of as background thread, use BITS capacity to
move files. Worked will so far.

VJ

"pradeep_TP" <pr*******@discussions.microsoft.comwrote in message
news:D1**********************************@microsof t.com...
Hello All,

I am developing a file uploading sever. I am planning to create this as a
multithreaded application in which every file upload request will be done
through a separate thread from the thread pool. While going through some
articles on the internet, I came to know that it is a bad practice to
allocate thread from thread pool for long running application.

I would like to know what other alternatives are available in the
threading
context, so that I can delegate the task of uploading files to different
threads for files which are very large in size.

Thanks
pradeep_tp

Mar 15 '07 #2
You shouldn't take the approach that you described - you'll be causig
yourself all sorts of problems and really limiting your applications
performance and scalability.

I strongly suggest that you spend some time looking into Asyncronous I/O, as
this is by far the best mechanism to handle multiple incoming file streams.

Depending on your use case, you could also look into BITS, and MTOM. I
believe there are also some File Upload controls available for ASP.Net 2.0 -
these may do the trick for you as well.

--
Chris Mullins, MCSD.NET, MCPD:Enterprise, Microsoft C# MVP
http://www.coversant.com/blogs/cmullins

"pradeep_TP" <pr*******@discussions.microsoft.comwrote in message
news:D1**********************************@microsof t.com...
Hello All,

I am developing a file uploading sever. I am planning to create this as a
multithreaded application in which every file upload request will be done
through a separate thread from the thread pool. While going through some
articles on the internet, I came to know that it is a bad practice to
allocate thread from thread pool for long running application.

I would like to know what other alternatives are available in the
threading
context, so that I can delegate the task of uploading files to different
threads for files which are very large in size.

Thanks
pradeep_tp

Mar 15 '07 #3
VJ <no***********@yahoo.comwrote:
really? can I see the article. All I have seen is thread pool is the best
practice...
If you allocate long running tasks to the system threadpool, you can
easily swamp the threadpool.

The fact that the threadpool is a singleton is a major pain in the
neck. I tend to prefer using my own separate threadpool, or just new
threads.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet Blog: http://www.msmvps.com/jon.skeet
If replying to the group, please do not mail me too
Mar 15 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: gianguz | last post by:
The question is about the possible use of inlining to improve performance in a heavy multithreading environment (200+ threads). If we have to work with applications in which threads aren't I/O...
29
by: pb648174 | last post by:
I have a very long transaction that runs on the same database that other users need to use for existing data. I don't care if they see data from the transaction before it is done and am only using...
16
by: Robert Zurer | last post by:
Can anyone suggest the best book or part of a book on this subject. I'm looking for an in-depth treatment with examples in C# TIA Robert Zurer robert@zurer.com
5
by: Yuliaan | last post by:
Hi everyone! In program I wrote, I try to run 300 threads, when only 10 is running in the same time. I use array to create 300 threads, but first I start only 10, after that I add one thread when...
16
by: who be dat? | last post by:
Consider the following code which enables multithreading in an ASP.Net application I'm writing: Code in global.asx Application_start subroutine, Threadnotify is declared Globally as a new thread...
5
by: MS Newsgroups | last post by:
Hi, I have an application that runs a timer and executes a method in a class as a new thread every 60 seconds, the thread takes 65 seconds to execute so there is a 5 second overlap when 2...
2
by: SStory | last post by:
Here is the situation. I want to display Icons, Type of file etc from a file extension. Upon initial program load I may only need icons for certain files. But other operations will require...
2
by: Pradnya Patil | last post by:
hi , I am trying to draw ' html div-tag ' on the screen which will resemble a rectangle through vb.net code. I want it to be drawn faster...so I introduced multithreading using Threadpool. I...
0
luke14free
by: luke14free | last post by:
Hello, I was trying to run a multithreading example with python on my phone that lets me to record and play at the same time.I've found an example somewhere but, as expected it doesnt work,,,could...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.