473,503 Members | 1,678 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 1197
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******@chlamydia-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.this.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
2019
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...
47
3687
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
8469
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
2119
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...
9
2441
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...
2
2297
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...
55
3255
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...
5
2476
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...
2
2240
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...
7
16282
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...
0
7201
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,...
0
7083
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...
0
7278
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,...
1
6988
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...
0
7456
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...
0
4672
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3166
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...
1
734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
379
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...

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.