473,657 Members | 2,716 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

multithreading

Hi
I have written a program which receives mails from server using POP3.
it's downloading sequentially. now i want to use the multithreading
in this regard where i can create threads for each and every
mail...and download those mails simaltaneously.
if u have any idea please help me out.
Regards
request
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 17 '05 #1
4 1204
On 16 Mar 2005 07:37:16 -0600,
ka************* ***@catalytic-dot-com.no-spam.invalid (request) wrote:
Hi
I have written a program which receives mails from server using POP3.
it's downloading sequentially. now i want to use the multithreading
in this regard where i can create threads for each and every
mail...and download those mails simaltaneously.
if u have any idea please help me out.


First, be careful to to share resources without synchronization : two
threads shouldn't write to the same file simultaneously, for example.
Mutexes, critical sections and semaphores can be useful for this,
depending on the circumstances.

I would look around on SourceForge, CodeProject, and CodeGuru for
projects that do similar things -- perhaps as servers -- and learn
about synchronization between threads.

Since your application is a client, it can start a thread for each
POP3 server. If the e-mails are being written to separate files, you
only need to coordinate file names between the threads; if appended to
a single mailbox thread, then the threads will have to wait for each
other to finish writing a message before beginning to write their own.

Another option would be for each receiver thread to write each message
to a temp file. An additional thread would be signaled when a file is
complete and append it to the inbox.

I hope this helps and gives you some ideas.

--
Sev
Nov 17 '05 #2
request wrote:
Hi
I have written a program which receives mails from server using POP3.
it's downloading sequentially. now i want to use the multithreading
in this regard where i can create threads for each and every
mail...and download those mails simaltaneously.
if u have any idea please help me out.

Idea about what? At first, opening a connection for each email
separately doesn't sound good, first because it would increase the load
on server, and second because it may look like a password attack and I
do not know if all servers will allow many connections from the same
address (mine wouldn't). :-)
Nov 17 '05 #3
On Wed, 16 Mar 2005 17:26:02 GMT, Severian
<se******@chlam ydia-is-not-a-flower.com> wrote:

I have corrected several typos in my response below. Then I must go do
some real work until my brain starts working properly again!
On 16 Mar 2005 07:37:16 -0600,
ka************ ****@catalytic-dot-com.no-spam.invalid (request) wrote:
Hi
I have written a program which receives mails from server using POP3.
it's downloading sequentially. now i want to use the multithreading
in this regard where i can create threads for each and every
mail...and download those mails simaltaneously.
if u have any idea please help me out.


(I am assuming you are downloading from multiple servers
simultaneously, and not trying to download a bunch of messages from a
single account; I don't believe POP3 even supports the latter)

First, be careful *not* to share resources without synchronization :
two threads shouldn't write to the same file simultaneously, for
example. Mutexes, critical sections and semaphores can be useful for
this, depending on the circumstances.

I would look around on SourceForge, CodeProject, and CodeGuru for
projects that do similar things -- perhaps as servers -- and learn
about synchronization between threads.

Since your application is a client, it can start a thread for each
POP3 server. If the e-mails are being written to separate files, you
only need to coordinate file names between the threads; if appended to
a single mailbox *file*, then the threads will have to wait for each
other to finish writing a message before beginning to write their own.

Another option would be for each receiver thread to write each message
to a temp file. An additional thread would be signaled when a file is
complete and append it to the inbox.

I hope this helps and gives you some ideas.

--
Sev
Nov 17 '05 #4
On Wed, 16 Mar 2005 19:32:10 +0200, Ioannis Vranos
<iv*@remove.thi s.grad.com> wrote:
request wrote:
Hi
I have written a program which receives mails from server using POP3.
it's downloading sequentially. now i want to use the multithreading
in this regard where i can create threads for each and every
mail...and download those mails simaltaneously.
if u have any idea please help me out.

Idea about what? At first, opening a connection for each email
separately doesn't sound good, first because it would increase the load
on server, and second because it may look like a password attack and I
do not know if all servers will allow many connections from the same
address (mine wouldn't). :-)


I assumed he meant different POP3 servers or at least accounts (I use
3 servers and 5 accounts). I don't think the POP3 protocol even allows
multiple connections to the same account.

--
Sev
Nov 17 '05 #5

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

Similar topics

1
2047
by: dixp | last post by:
I'm new to writing multithreaded apps and I have a design question. I have a winforms app and a class which has a method that does processing which is time intensive. I want the user to be able to kick off the process and continue to work in the appliaction while getting progress updates and the ability to cancel. The method that seems easiest to me is this: The class exposes certain events for progress. Start, ProgressUpdate, and...
47
3722
by: mihai | last post by:
What does the standard say about those two? Is any assurance that the use of STL is thread safe? Have a nice day, Mihai.
16
8493
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
2133
by: sarge | last post by:
I would like to know how to perform simple multithreading. I had created a simple form to test out if I was multithreading properly, but got buggy results. Sometime the whole thig would lock up when I got two threads going at the same time. What I have is two text boxes (textBox1 and textBox2) and four buttons(cmdStartThread1, cmdStartThread2, cmdStopThread1, cmdStopThread2)
9
2455
by: tommy | last post by:
hi, i have found a example for multithreading and asp.net http://www.fawcette.com/vsm/2002_11/magazine/features/chester/ i want to speed up my website ... if my website is starting, they should build a database-connection and send a few sqls
2
2307
by: Rich | last post by:
Hello, I have set up a multithreading routine in a Test VB.net proj, and it appears to be working OK in debug mode and I am not using synchronization. Multithreading is a new thing for me, and I just wanted to ask if I am missing anything based on the following scenario. My test app pulls data from a large external data source which has a table-like structure (but not rdbms - more
55
3299
by: Sam | last post by:
Hi, I have a serious issue using multithreading. A sample application showing my issue can be downloaded here: http://graphicsxp.free.fr/WindowsApplication11.zip The problem is that I need to call operations on Controls from a delegate, otherwise it does not work. However each time I've done an operation, I must update the progressbar and progresslabel, but this cannot be done in the delegate as it does not work.
5
2483
by: sandy82 | last post by:
Whats actuallly multithreading is ... and how threading and multithreading differ . Can any1 guide how multithreading is used on the Web .. i mean a practical scenario in which u use multithreading online using C# .
2
2253
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. **************
7
16301
by: Ray | last post by:
Hello, Greetings! I'm looking for a solid C++ multithreading book. Can you recommend one? I don't think I've seen a multithreading C++ book that everybody thinks is good (like Effective C++ or Exceptional C++, for example). Platform-specific (e.g.: Win32, POSIX) is OK, as long as it's good :) Thank you, Ray
0
8303
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8821
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8502
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
8602
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...
0
4150
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
4300
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
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
1941
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1601
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.