Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.forth > #59903
| From | anton@mips.complang.tuwien.ac.at (Anton Ertl) |
|---|---|
| Newsgroups | comp.lang.forth |
| Subject | Re: illustration of syscalls fork and mmap |
| Date | 2017-05-27 06:21 +0000 |
| Organization | Institut fuer Computersprachen, Technische Universitaet Wien |
| Message-ID | <2017May27.082119@mips.complang.tuwien.ac.at> (permalink) |
| References | (4 earlier) <29fda2ee-cea0-4d57-8e93-5314f4fd03f0@googlegroups.com> <5927ef54$0$1548$e4fe514c@textnews.kpn.nl> <a5e99443-c04a-45f6-8276-170a9dd8e8c5@googlegroups.com> <2017May26.172204@mips.complang.tuwien.ac.at> <a840b8e4-18c9-493e-9d07-58c63cf45bef@googlegroups.com> |
krishna.myneni@ccreweb.org writes:
>On Friday, May 26, 2017 at 10:53:22 AM UTC-5, Anton Ertl wrote:
>...
>> Many people are too euphoric about using multi-threading (or other
>> kinds of shared-memory or distributed-memory multiprocessing
>> parallelization) for getting speedups. You get additional kinds of
>> bugs (race conditions, deadlocks), execution is not perfectly
>> reproducible, which makes debugging harder, and as result, you get
>> only a speedup by a small factory, and you consume at least as much
>> CPU time as before. It's better to first apply techniques for
>> speeding up single threads; in the present case you can use
>> vectorization and cache blocking to get quite a bit more. Once you
>> are close to the limit of single-thread performance, one can consider
>> multiprocessing.
>>=20
>
>Somewhat naively, I would think that the two activities commute: 1) writing=
> the code for parallel (multi-process/multi-thread) computation, and 2) wri=
>ting the code for high efficiency in a single process. Your argument about =
>the preferred order is that a greater gain will be realized in a shorter ti=
>me by doing 2) first
Yes, that is my point. Of course, when optimizing the single-threaded
program, the more you optimize, the lower the gains of the next step,
and at some point, using multiple cores will be more cost-effective.
But I often see people thinking about using multiple cores long before
that point is reached.
>But, I can think of examples where you might want to start with t=
>he multi-processing approach first, e.g. a data acquisition application con=
>sisting of one part which continuously takes data at a high-rate and a seco=
>nd part which displays the data in a graphics window at periodic intervals.=
> The first part (acquiring the data) needs to operate with very low latency=
>, maybe on the microsecond time scale, while the display part needs to oper=
>ate on a different time scale of visual refresh rates. Such an application =
>would seem ideal for coding with parallel computing from the outset.
Sure, here you have requirements that make multi-tasking a natural
fit. I.e., you would go for it even if you don't have multiple cores.
That's the difference between "parallel computing" and "concurrent
computing".
- anton
--
M. Anton Ertl http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html
New standard: http://www.forth200x.org/forth200x.html
EuroForth 2017: http://www.euroforth.org/ef17/
Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-13 12:25 -0700
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-22 16:00 -0700
Re: illustration of syscalls fork and mmap anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-23 12:01 +0000
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-23 16:30 -0700
Re: illustration of syscalls fork and mmap anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-24 10:13 +0000
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-24 13:59 -0700
Re: illustration of syscalls fork and mmap anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-25 08:47 +0000
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-25 04:04 -0700
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-25 04:29 -0700
Re: illustration of syscalls fork and mmap anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-25 11:27 +0000
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-25 05:23 -0700
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-25 16:54 -0700
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-25 19:19 -0700
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-25 19:34 -0700
Re: illustration of syscalls fork and mmap Roelf Toxopeus <rt4all@nothishetnet.nl> - 2017-05-26 11:03 +0200
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-26 05:15 -0700
Re: illustration of syscalls fork and mmap anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-26 15:22 +0000
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-26 17:13 -0700
Re: illustration of syscalls fork and mmap josv@planet.nl - 2017-05-26 23:26 -0700
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-27 06:20 -0700
Re: illustration of syscalls fork and mmap josv@planet.nl - 2017-05-27 07:41 -0700
Re: illustration of syscalls fork and mmap anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-05-27 06:21 +0000
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-27 06:32 -0700
Re: illustration of syscalls fork and mmap Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-05-27 01:17 -0500
Re: illustration of syscalls fork and mmap josv@planet.nl - 2017-05-26 23:43 -0700
Re: illustration of syscalls fork and mmap Andrew Haley <andrew29@littlepinkcloud.invalid> - 2017-05-27 01:49 -0500
Re: illustration of syscalls fork and mmap mhx@iae.nl - 2017-05-28 03:25 -0700
Re: illustration of syscalls fork and mmap josv@planet.nl - 2017-05-28 04:56 -0700
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-27 06:53 -0700
Re: illustration of syscalls fork and mmap Roelf Toxopeus <rt4all@nothishetnet.nl> - 2017-05-27 10:23 +0200
Re: illustration of syscalls fork and mmap krishna.myneni@ccreweb.org - 2017-05-27 12:07 -0700
csiph-web