"Threading" - New exercise available on Ziglings!

Ziglings - Learn the :zap:Zig programming language by fixing tiny broken programs.

// Whenever there is a lot to calculate, the question arises as to how
// tasks can be carried out simultaneously. We have already learned about
// one possibility, namely asynchronous processes, in Exercises 84-91.
// However, the computing power of the processor is only distributed to
// the started tasks, which always reaches its limits when pure computing
// power is called up.
// For example, in blockchains based on proof of work, the miners have
// to find a nonce for a certain character string so that the first m bits
// in the hash of the character string and the nonce are zeros.
// As the miner who can solve the task first receives the reward, everyone
// tries to complete the calculations as quickly as possible.
// This is where multithreading comes into play, where tasks are actually
// distributed across several cores of the CPU or GPU, which then really
// means a multiplication of performance.

These examples are so clean and well organized. Great work.

1 Like