The Shinobi World's Coder
Chapter 98

Threads Running Low! How Can I Fix It? (Second Update)

1,179 words•4 min read•2 views
23d ago•
Next

Warning! Performance Monitor Alert! Processor: 98% (Critical) Memory: 2.9/4.0 GB (7%) Disk Active Time: 89% The hardware was groaning!

What was going on? Why was he lagging!?

Hiroki was taken aback. He quickly entered his mindscape and opened the Task Manager!

After all, Hiroki had been through multiple battles. He no longer let useless emotions well up during a fight!

The moment he opened Task Manager, he realized what the problem was!

Too many threads!

It wasn't a lack of memory—it was too many threads!

The moment the battle began, following the Third Hokage's orders, he'd started data-transfer tasks for every unconscious non-Konoha Ninja on the field.

With multiple copies running concurrently, each target had more than a dozen ninjutsu files to process, and each file needed its own thread to scan, read, parse, and transfer—

It was like using an old single-core processor to manage an unknown number of threads. The CPU was switching frantically between them, and the overhead from context switching was eating up almost all its performance!

A thread was like a chef preparing several dishes at once, switching between them.

Imagine you were making three dishes:

You were cooking Dish A (the current thread).

Suddenly, the soup for Dish B was about to boil over!

You had to: ① Remember how far you'd gotten with Dish A (save state).

② Put down the spatula and run over to Dish B (switch).

③ Recall how far along Dish B was (load state).

④ Deal with Dish B, then switch back to Dish A and pick up where you'd left off. That process was called a context switch!

Even Hiroki couldn't handle that level of thread and context-switching overhead while copying multiple ninjutsu from multiple ninjas!

And now, on top of all that, he was

End of Chapter
Prev
NovelSummaries
Next

Explore the wiki

Comments