Click here to Skip to main content
15,891,431 members
Home / Discussions / C#
   

C#

 
QuestionVS c# Express - Deployment Project Pin
ranzask27-Jan-06 5:18
ranzask27-Jan-06 5:18 
AnswerRe: VS c# Express - Deployment Project Pin
Dave Kreskowiak27-Jan-06 5:35
mveDave Kreskowiak27-Jan-06 5:35 
GeneralRe: VS c# Express - Deployment Project Pin
ranzask27-Jan-06 8:51
ranzask27-Jan-06 8:51 
GeneralRe: VS c# Express - Deployment Project Pin
Dave Kreskowiak27-Jan-06 18:12
mveDave Kreskowiak27-Jan-06 18:12 
QuestionHow can I see if LeftShift or RightShift was pressed? Pin
adfgh7527-Jan-06 4:51
adfgh7527-Jan-06 4:51 
AnswerRe: How can I see if LeftShift or RightShift was pressed? Pin
tarasn27-Jan-06 5:56
tarasn27-Jan-06 5:56 
GeneralRe: How can I see if LeftShift or RightShift was pressed? Pin
adfgh7530-Jan-06 9:12
adfgh7530-Jan-06 9:12 
QuestionThread synchronization question Pin
User 665827-Jan-06 3:56
User 665827-Jan-06 3:56 
Hi everybody!

Currently I'm developing a simple mail server. It works fine so far, but I have a design issue due to the heavy threading my app uses:

I have a number of SMTPClientThreads, which all may open the same MailBox at the same time to add mail oder query existing data. It looks like this (inside of a SMTPClientThread):

MailBox box = new MailBox("username");<br />
box.AddMail(mail);<br />
box.Save();


new Mailbox() will load the mailbox from an XML file, save everying into a List<Mail> and close the file handle, Save() will write the List back to the XML and save the handle.

Now one or multiple SMTP Clients might want to add or query data from the same mailbox at the same time.
How do I handle this correctly? I've read about the lock statement, but I don't know how to use it correctly in this case.

regards

modified 12-Sep-18 21:01pm.

AnswerRe: Thread synchronization question Pin
Guffa27-Jan-06 4:21
Guffa27-Jan-06 4:21 
GeneralRe: Thread synchronization question Pin
User 665827-Jan-06 6:58
User 665827-Jan-06 6:58 
AnswerRe: Thread synchronization question Pin
Guffa27-Jan-06 8:43
Guffa27-Jan-06 8:43 
GeneralRe: Thread synchronization question Pin
User 665827-Jan-06 10:42
User 665827-Jan-06 10:42 
QuestionShow Window Pin
jzb27-Jan-06 3:27
jzb27-Jan-06 3:27 
AnswerRe: Show Window Pin
Dave Kreskowiak27-Jan-06 5:26
mveDave Kreskowiak27-Jan-06 5:26 
AnswerRe: Show Window Pin
jzb27-Jan-06 18:07
jzb27-Jan-06 18:07 
QuestionRowUpdating Event Pin
lordofcsharp27-Jan-06 1:48
lordofcsharp27-Jan-06 1:48 
QuestionHelp Regarding Crystal Report Pin
Taimoor Mirza27-Jan-06 1:17
Taimoor Mirza27-Jan-06 1:17 
AnswerRe: Help Regarding Crystal Report Pin
ltxuan27-Jan-06 1:56
ltxuan27-Jan-06 1:56 
GeneralRe: Help Regarding Crystal Report Pin
Taimoor Mirza27-Jan-06 2:01
Taimoor Mirza27-Jan-06 2:01 
QuestionTooltip popup on pointing to text. As a plugin in VS .NET Pin
AlnKG27-Jan-06 0:56
AlnKG27-Jan-06 0:56 
QuestionGRAPHICS.FILLELLIPSE Pin
Greeky27-Jan-06 0:44
Greeky27-Jan-06 0:44 
AnswerRe: GRAPHICS.FILLELLIPSE Pin
leppie27-Jan-06 1:03
leppie27-Jan-06 1:03 
GeneralRe: GRAPHICS.FILLELLIPSE Pin
Greeky27-Jan-06 1:39
Greeky27-Jan-06 1:39 
QuestionInstaller CD Pin
Mugombi27-Jan-06 0:16
Mugombi27-Jan-06 0:16 
AnswerRe: Installer CD Pin
James Gupta27-Jan-06 1:59
professionalJames Gupta27-Jan-06 1:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.