I need to parallelize a simple password cracker in order to use it on an n-processor system. My idea is to create n threads and feed them more and more work as they are completed.
What is the best way to find out when a thread is completed? Mutex? Is it worth checking this mutex constantly while other threads are working?
You can have a simple queue structure - use whatever data structure you like, and then just use the mutex when you add / remove elements from it.
, , "", , .
, 1 1 , .
, ; , pthread_join.
: -
→ ( ). → (, - , , !)
, , - , .
, MCP ( !) , .
, .
" " , .
mutex, . Pthread (., , pthread_cond_create (...)).
Source: https://habr.com/ru/post/1703384/More articles:Why does the full-text string search "FDR" not return results in MySQL? - mysqlThe correct way to clear a constant thread in C # - multithreadingWhy is my asp.net caching throwing an exception? - cachingWindows service stops and starts immediately, but it should not - c #SQL Convert decimal float to varchar - floating-point"method overload" in javascript - javascriptApplescript, multiple monitors and maximum window sizes - applescriptUnderstanding CLS Compliance and Correct Code - vb.netUse computed property as DisplayColumn in ASP.Net dynamic data? - asp.netCan I create a .NET framework class to implement the interface that I define? - .netAll Articles