[Plugin] Bcrypt
#11

Quote:
Originally Posted by BigETI
View Post
Ouch STL containers are not really thread safe. I've experimented with threads (from WINAPI) once, and it just accessed bad memory while the first thread was inserting information and the second one attempted to read it.

Also you are creating threads after the native function gets called. Realize your server attempts to call this native several times, and you are creating too many threads at once (again this can crash your application)
I decided to test this by calling bcrypt_hash (work factor 12) 400 times with a for loop. The server did not crash and calculated the hash for each call. It might be that the server crashes if even more concurrent threads are created, but I really doubt that's going to happen under normal circumstances.


Edit: As to the issue with thread safety, what would you recommend as a solution? Based on quick research, the use of mutexes seems promising.
Reply


Messages In This Thread
Bcrypt (Password hash) - by Johnson_boy - 25.07.2013, 12:59
AW: Bcrypt - by Poket-Jony - 25.07.2013, 13:02
Re: Bcrypt - by Djole1337 - 25.07.2013, 13:17
Re: Bcrypt - by roschti - 25.07.2013, 13:52
AW: Bcrypt - by BigETI - 25.07.2013, 14:24
Re: Bcrypt - by Johnson_boy - 25.07.2013, 14:30
Re: Bcrypt - by Johnson_boy - 25.07.2013, 16:33
Re: Bcrypt - by Edvin - 25.07.2013, 17:54
Re: Bcrypt - by Maxips2 - 25.07.2013, 19:30
AW: Bcrypt - by BigETI - 25.07.2013, 20:37
Re: AW: Bcrypt - by Johnson_boy - 25.07.2013, 21:59
Re: Bcrypt - by Red_Dragon. - 26.07.2013, 03:09
Re: Bcrypt - by Dan.. - 26.07.2013, 07:12
Re: Bcrypt - by Niko_boy - 26.07.2013, 07:20
Re: Bcrypt - by Johnson_boy - 26.07.2013, 17:23
Re: Bcrypt - by Dan.. - 26.07.2013, 18:27
AW: Re: Bcrypt - by BigETI - 26.07.2013, 23:32
Re: Bcrypt - by Lorenc_ - 27.07.2013, 01:43
Re: Bcrypt - by Dan.. - 27.07.2013, 07:51
Re: Bcrypt - by Johnson_boy - 28.07.2013, 12:10
Re: Bcrypt - by Johnson_boy - 06.08.2013, 23:45
Respuesta: Bcrypt - by GutierrezDeVelasco - 25.01.2014, 21:40
Respuesta: Bcrypt - by GutierrezDeVelasco - 25.01.2014, 21:49
Re: Bcrypt - by Kaperstone - 20.07.2014, 22:10
Re: Bcrypt - by Johnson_boy - 21.07.2014, 08:11
Re: Bcrypt - by maddinat0r - 21.07.2014, 20:07
Re: Bcrypt - by Sonical - 28.07.2014, 20:44
Re: Bcrypt - by Kaperstone - 28.08.2014, 23:30
Re: Bcrypt - by Kaperstone - 18.11.2014, 02:50
Re: Bcrypt - by Johnson_boy - 20.11.2014, 22:03
Re: Bcrypt - by Kaperstone - 21.11.2014, 04:49
Re : Bcrypt - by Maxime_Creteur - 25.11.2014, 18:21
Re : Bcrypt - by Nealll - 28.11.2014, 18:48
Re: Re : Bcrypt - by Johnson_boy - 28.11.2014, 20:35
Re : Bcrypt - by Nealll - 29.11.2014, 06:40
Re: Bcrypt - by Kaperstone - 01.12.2014, 13:33
Re : Bcrypt - by Nealll - 01.12.2014, 15:49
Re: Bcrypt - by Johnson_boy - 01.12.2014, 23:49
Re: Bcrypt - by ProKillerpa - 01.12.2014, 23:51
Re : Bcrypt - by Nealll - 02.12.2014, 18:20

Forum Jump:


Users browsing this thread: 1 Guest(s)