User: Password:
Subscribe / Log in / New account

Single-threading not considered harmful

Single-threading not considered harmful

Posted May 19, 2011 9:11 UTC (Thu) by renox (subscriber, #23785)
In reply to: Single-threading not considered harmful by jberkus
Parent article: Scale Fail (part 1)

I think that 'single-threading' is correct the issue is that when we think about multi-threading we only think about multi-threading within one process but multi-processing is also multi-threading (because each process contains at least one thread).

Maybe multi/single-tasking would be better terms?

(Log in to post comments)

Single-threading not considered harmful

Posted May 22, 2011 10:47 UTC (Sun) by kplcjl (guest, #75098) [Link]

Actually, I don't see multi-threading as anything but handling single processes multiple concurrent times. It doesn't matter if you are talking about 5 services doing a single different thing in each or if a single service is setting up multiple threads to do the same process several times at once.

The problem is recognizing when a dedicated single process is the best answer to your problem or when multiple threads on the same server would be best. Generally, when your problem is data driven, the multiple thread solution would be better and when your problem is cpu intensive, a single thread dedicated to solving the problem combined with a data storage mechanizm so multiple servers can attack several individual problems concurrently may be the way to go.

This article seems to cover the situation where one of those solutions fit and therefore it becomes the "best" solution for every situation. It doesn't seem to apply to dumb coding mistakes that make good design go bad. For instance, I saw one case where it should have used "-" instead of "+" in one place of a mathematical equation. It took me a week and a half to convince the manager there was a mistake in the equation.

Single-threading not considered harmful

Posted May 22, 2011 11:08 UTC (Sun) by kplcjl (guest, #75098) [Link]

I misspoke, when I said "multiple concurrent times". On a single core nothing works that way. I was thinking of the OS scheduling the core's use to make it appear it is doing concurrent processing to the human onlooker as well as multiple cores doing true concurrent work.

Copyright © 2017, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds