Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ MT-multithreading and servers » SSL server crash
Re: SSL server crash [message #33731 is a reply to message #33729] Fri, 09 September 2011 10:00 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13980
Registered: November 2005
Ultimate Member
Zbych wrote on Fri, 09 September 2011 03:11

mirek wrote on Thu, 08 September 2011 20:42

Not sure if that is the cause, but you definitiely should NOT do client.Add in one thread and client.Remove in another, you need mutex serialization for that...

Mirek


More interesting question is whether I can use Add and operator[] (protected by mutex) at the same time in two different threads . Vector manual states that Add "Invalidates iterators and references to Vector."



If it is protected by mutex, you can.

Of course, what you cannot is to take a reference (pointer) to element and then unlock the mutex and use this reference. But that is sort of same in single-threaded.

Using Mutex is no magic - each time you need to access a shared variable, you need to "lock" it, so that other thread does not change its content during operation...
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: A new function to Web Package Unicode-Escape-Javascript -> Unicode
Next Topic: Multi-Thread Critial Section Problem
Goto Forum:
  


Current Time: Sun May 19 00:51:22 CEST 2024

Total time taken to generate the page: 0.01859 seconds