Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

threaded progames

Name: Anonymous 2010-08-05 0:19

So guys I hear of many people saying single threaded programs suck. I personally program in java and i have a question. Even when i make a single thread program in java and then look @ it via jconsole it appears to have ~5-10 threads up at any time. Does that mean it's already multi-threaded and really wouldn't make a shit load of a difference since i'm already using multiple cores?

Name: Anonymous 2010-08-05 0:33

ERLANG

Name: Anonymous 2010-08-05 0:41

0/10

Name: Anonymous 2010-08-05 0:48

this is a serious question guys

Name: Anonymous 2010-08-05 1:00

If your operating system distinguishes between threads and processes, it's a shitty operating system. If a person tells you single-threaded programs suck, he's a shitty person.

Name: Anonymous 2010-08-05 1:03

>>5
What a fanboy.

Name: Anonymous 2010-08-05 1:03

>>2
Ok. You got me wet. Don't stop!

Name: Anonymous 2010-08-05 1:15

>>1
I believe you are mistaking user threads and the JVM's threads.  Assume the bytecode of any single-threaded program you write runs on a single thread only (yes, even for an application that utilizes Swing components and Events; you should not have to think about the threads that actually handle user input and draw updates).

Name: Anonymous 2010-08-05 9:07

>>1

Why do single-threaded programs suck exactly? Threads are very rarely actually useful.

Name: Anonymous 2010-08-05 10:36

>>9
He's also programming in Java, so it would logically follow that he's getting this information from business-types who have no clue.

Name: Anonymous 2010-08-05 11:03

>>9
He's either trolling or ignorant. Multi-threading vs. single-threading is simply a matter of using the right tool for the job.

Name: Anonymous 2010-08-05 11:08

>>9
Ever heard of the term concurrency?

For instance, I wrote a 4chan image scraper. Single threaded it would take unbelievably fucking long to finish. Multi threaded finishes in a fraction of the time.

Name: Anonymous 2010-08-05 11:17

multi thread is faster and thats just it.

Name: Anonymous 2010-08-05 11:24

You know, /prog/ almost never talks about multi threading.  This thread is a rarity.  Why is that?

Name: Anonymous 2010-08-05 12:25

>>14

Because.

Name: Anonymous 2010-08-05 13:24

>>14
Because multi-threading is neither hard nor interesting. It's a very poor solution to something that's barely a problem.

Name: Anonymous 2010-08-05 14:16

>>12
Single threaded does not necessarily mean sequential. However, even a sequential scraper could make more requests before completing the work on the previous request. Once again, CPU time is not the bottleneck.

>>14
Because people like >>12-kun here are more or less representative of the vocal crowd. Of the people who bring it up, /prog/ is only vaguely aware that "process" and "thread" can take on distinct meanings, never mind "multithreading" and "concurrency." I'd love to discuss concurrency and related topics all day long, but not here.

Name: Anonymous 2010-08-05 20:59

>>17
>believing >>12's problem would be better solved by an environment where multiple processes share a single thread

Name: Anonymous 2010-08-05 21:52

>>18
Not at all. If you think that's what I was saying you suffer from the same kind of brain damage as >>12 (or maybe you are >>12.)

You should reread >>17 until you can draw a different conclusion from it. (Hint: it's already been delineated elsewhere in this thread.)

Name: Anonymous 2010-08-05 22:34

>>18
Refrain from improperly quoting non-existent text. Seeing text that isn't there could be an indication of serious mental problems, and may require a deportation back to the imageboards.

Name: Anonymous 2010-08-06 12:45

>>20
QUOTE MY ANUS

Name: Anonymous 2010-08-06 15:05

You guys no nothing about the benefits of multithreading.

Name: Anonymous 2010-08-06 15:06

>>22
... and you no[sic] nothing about the benefits of correct English.

Name: Anonymous 2010-08-06 15:07

>>23
I don't type very well.

I'm dyslexic, so eat my shit.

Name: Anonymous 2010-08-06 15:08

>>23
CORRECT MY ANUS

Name: Anonymous 2010-08-06 15:12

>>24
Is that your excuse for not having read the thread?

Name: Anonymous 2010-08-06 15:13

>>26
>implying arguments made by nobodies on a shitty programming board know half the stuff they spew out

Name: Anonymous 2010-08-06 15:15

>>27
STUFF MY ANUS

Name: Anonymous 2010-08-06 16:57

>>27
Refrain from improperly quoting non-existent text. Seeing text that isn't there could be an indication of serious mental problems, and may require a deportation back to the imageboards.

Name: Fuck off, !Ep8pui8Vw2 2010-08-06 19:24

Name: Anonymous 2010-08-06 22:14

guy so i have this game with a large map 1000x1000x1000 stored in memory. I have to then update all of the cells of the map and i have a few choices. I can make it one single thread that takes a long long long time to finish or i can split it up into ~5000 threads that check their own section of the map.


which is a better idea and should i take another approach?

Name: Anonymous 2010-08-06 22:16

>>31
IHBT

Name: Anonymous 2010-08-06 22:38

>>31
Threaded programs suck. Your users, or should I say, [b]lusers[/u], can wait,

Name: Anonymous 2010-08-06 22:46

>>33
YOU FAILED AT BBCODES
HAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHAHA

Name: Anonymous 2010-08-06 23:42

>>31
If you have a legitimate reason where execution time will greatly improve for a problem that can be split up into concurrent blocks, by all means use threads.

Don't listen to /prog/. Most of the people here are fucking retarded.

Name: Anonymous 2010-08-06 23:43

>>35
Most of the people here are fucking retarded.
That's funny, coming from someone who recommends multi-threading over the much more sensible multi-processing.

Name: Anonymous 2010-08-06 23:48

>>36
Multi-processing has no memory sharing between processes.

Hence, isn't ideal in some situations.

Name: Anonymous 2010-08-07 0:02

>>37
Shared memory is a retarded idea in almost all situations.

Name: Anonymous 2010-08-07 0:03

>>37
You can share memory if you want to, you just have to be really explicit and deliberate about it. Which is the way it should be.

Name: Anonymous 2010-08-07 0:09

>>39
Hence why multiprocessing is obviously more sensible than multithreading. And >>37 is stupid, it's not only possible but in fact easy to share memory between processes.

Name: Anonymous 2010-08-07 0:14

/prog/ what is multiprocessing vs multithreading?

Name: Anonymous 2010-08-07 0:38

>>41
Ask in /pr/.

Name: Anonymous 2010-08-07 0:47

>>41
http://www.cs.cf.ac.uk/Dave/C/node29.html#SECTION002910000000000000000

The terms are used by convention (and/or according to a particular standard or document) so I wouldn't take that as absolutely definitive, but it will give you a good idea.

Name: Anonymous 2010-08-07 1:21

>>43
You HELPED HIM!

Name: Anonymous 2010-08-07 2:07

>>44
There are about 50 people on /prog/ who don't have a clue about this stuff. That's ~45-47 more than there are people here, so it is a serious problem. They're not going away, so education is the only option.

I forgot to note in >>43 that "threads" and "processes" as discussed in that link don't even begin to explore concurrency.

Name: Anonymous 2011-02-03 2:50

Name: Anonymous 2011-02-04 16:17

Name: Anonymous 2011-02-04 16:39

Don't change these.
Name: Email:
Entire Thread Thread List