SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 26/07/2013, 10:30 PM   #21
Y_Less
Spam Machine
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 14,821
Reputation: 3111
Default Re: Bcrypt

I would actually disagree with that. Creating threads does have a lot of overhead, but if you can create a pool of workers somewhat equal to the virtual cores on your machine then you will improve performance with more than 2.
Y_Less is offline   Reply With Quote
Old 26/07/2013, 11:32 PM   #22
BigETI
Gangsta
 
BigETI's Avatar
 
Join Date: Mar 2010
Location: Germany
Posts: 981
Reputation: 283
Default AW: Re: Bcrypt

Quote:
Originally Posted by Y_Less View Post
I would actually disagree with that. Creating threads does have a lot of overhead, but if you can create a pool of workers somewhat equal to the virtual cores on your machine then you will improve performance with more than 2.
You can't compare this situation to real life workers. Believe me or not for some unknown reason at some point it will behave weird, especially if you are working with dynamic memory. I can rely on facts I've collected by doing tests on multiple threads. I've made once a test application running at 3 threads (all threads include an inner infinite loop for processing 3 tasks at once all the time). No STL containers was involved, but at some point suddenly you access bad memory by even testing pointers for not returning zero. However at using 2 threads, it was running quite harmless (Yes, I am still using a dual core processor). Also you have to decide how many threads you want to use at once, because a processor with 2, 4, 6 or 8 cores can only work efficient at the amount of current important threads equals the amount of cores a processor has. I don't know what is more efficient, but are 8 threads doing something on a dual core processor more efficient than 4 threads doing something on a dual core processor?
BigETI is offline   Reply With Quote
Old 26/07/2013, 11:35 PM   #23
Y_Less
Spam Machine
 
Y_Less's Avatar
 
Join Date: Jun 2008
Location: 629 - git.io/Y
Posts: 14,821
Reputation: 3111
Default Re: Bcrypt

Having more threads doesn't mean your code will crash - writing bad code will mean your code will crash REGARDLESS of the number of threads. You most likely messed up the thread communication code.
Y_Less is offline   Reply With Quote
Old 27/07/2013, 01:43 AM   #24
Lorenc_
High-roller
 
Lorenc_'s Avatar
 
Join Date: Jan 2010
Location: Australia
Posts: 4,273
Reputation: 1134
Default Re: Bcrypt

Finally! Well done!

Is it possible for a non-threaded version? Thanks.
__________________
Join the best Cops And Robbers in SA-MP, today. svr.irresistiblegaming.com:7777

Lorenc_ is offline   Reply With Quote
Old 27/07/2013, 07:51 AM   #25
Dan..
Gangsta
 
Join Date: Jun 2012
Location: Galati, Romania
Posts: 521
Reputation: 122
Default Re: Bcrypt

Quote:
Originally Posted by Y_Less View Post
I would actually disagree with that. Creating threads does have a lot of overhead, but if you can create a pool of workers somewhat equal to the virtual cores on your machine then you will improve performance with more than 2.
Creating threads doesn't have a lot of overhead, but creating a new thread, executing it parallelly, collecting the result (there is a mutex that will waste a little more), sending it back to the main thread, killing the thread does.
__________________
I'm no longer visiting these forums. BlueG, you can suck my dick.
Dan.. is offline   Reply With Quote
Old 28/07/2013, 12:10 PM   #26
Johnson_boy
Huge Clucker
 
Join Date: Mar 2011
Location: Finland
Posts: 220
Reputation: 78
Default Re: Bcrypt

Quote:
Originally Posted by Lorenc_ View Post
Finally! Well done!

Is it possible for a non-threaded version? Thanks.
It's possible, but does not really make sense. If everything is executed in one thread, the server will have to wait while the hash is calculated, which will be noticed as lag by the players. Calculating a bcrypt hash takes a significant amount of time, about 0.5 seconds, when a work factor of appropriate magnitude is used.
Johnson_boy is offline   Reply With Quote
Old 06/08/2013, 11:45 PM   #27
Johnson_boy
Huge Clucker
 
Join Date: Mar 2011
Location: Finland
Posts: 220
Reputation: 78
Default Re: Bcrypt

Support for Windows added, precompiled binary (dll) is now available.
Johnson_boy is offline   Reply With Quote
Old 25/01/2014, 09:40 PM   #28
GutierrezDeVelasco
Little Clucker
 
GutierrezDeVelasco's Avatar
 
Join Date: Dec 2013
Location: Mexico
Posts: 33
Reputation: 5
Default Respuesta: Bcrypt

I need some help with this, i cant seem to find the plugin file but there is a c++ file named plugin and what do i do with all those c++ files i have no idea.
please help
GutierrezDeVelasco is offline   Reply With Quote
Old 25/01/2014, 09:49 PM   #29
GutierrezDeVelasco
Little Clucker
 
GutierrezDeVelasco's Avatar
 
Join Date: Dec 2013
Location: Mexico
Posts: 33
Reputation: 5
Default Respuesta: Bcrypt

lol nevermind i downloaded the wrong file :P
GutierrezDeVelasco is offline   Reply With Quote
Old 20/07/2014, 10:10 PM   #30
Kaperstone
High-roller
 
Kaperstone's Avatar
 
Join Date: May 2011
Location: Russia
Posts: 3,353
Reputation: 822
Default Re: Bcrypt

I have a few questions
  • Does it work with CentOS ?
  • And how do I know what is the maximum cost I can put in ?
  • If I change the cost someday with already a few accounts hashed with the previous cost, will their password still work after I change the cost ?
__________________
Kaperstone is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



All times are GMT. The time now is 05:48 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.