473,795 Members | 2,882 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2111
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*******@disc ussions.microso ft.comwrote in message
news:D1******** *************** ***********@mic rosoft.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*******@disc ussions.microso ft.comwrote in message
news:D1******** *************** ***********@mic rosoft.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.co m>
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
2341
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 bounded or user-time bounded (i.e. windows based applications) but they are concurrently involved in the execution of the same parallelized task (i.e. a matrix-matrix multiplication), we must ensure that the advantage obtained by the parallelization...
29
5822
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 the transaction because I need a way to roll it back if any errors happen during the transaction. Unfortunately all tables affected in the long running transaction are completely locked and nobody else can access any of the affected tables while...
16
8511
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
2763
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 some of them is finished. The first 10 are running well, but when I add one, I get the HashCode that different from 11, and the all next thread behave in the same way. Any suggestions, why it is happen? using System; using System.Threading;
16
1748
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 where it uses the address of EmailNotify below: ThreadNotify.IsBackground = True ThreadNotify.Start()
5
2325
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 threads are running. The problem i have is that i am experiencing sudden high CPU utilization that lasts for a couple of seconds, and i believe that i have managed to tie this down to occuring when the thread is terminated.
2
1666
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 showing all filetypes and icons. I have an object that has extension, desc (like Word Document) and then icon, which is nothing to start with. I have a collection object of these and when it is initialized it goes to
2
2268
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 divided the complete drawing into 3 parts..1st will be done by main thread and other two are done in these procedures - <1LongTimeTask <2LongTimeTask2 I have invoked the threads using below method. **************
0
3420
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 someone please correct it? I think it's full of errors or I've really wrong everything...:D import random import threading import time import audio #this is a mobile phone library! # This takes about n/3 seconds to run (about n/3 clumps of...
0
9673
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10216
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10165
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10002
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7543
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3728
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.