I'm newbie in C++ and trying to make 2 simple function but something goes wrong.
So i need to do:
1.Function for input some data.
2.Function to show what data is input.
I just want to make it simple. So the code that i write:
#include <iostream>
void masiv()
{
int x[10];
int n,...
Haven't found a need for xpressive yet, myself; although I suspect Spirit::Qi has a similar effect, I use external debug symbols so I'm not really bothered.
I've got a couple of libraries I'd love to tidy up for submission to Boost, but who has the time?
I am using open MP to speed up the flux calculation in my program. I basically want open Mp to carry out both of these left and right flux calculations in parallel. But on the contrary, the following code takes even more time with the #pragma directives. What do i modify to get it right?
#pragma...
seems like i'm suffering from amnesia.. i forgot what is the coined word for finding out what makes a program fail, memory leak in order to use that info to exploit a vulnerabilty.. is it "flash"?
In which I show how to use static thread locals to reuse function locals between invocations, and why this can be especially important when allocating on the heap. Let’s say you are writing parallel software to process something. It has a single Processor object, with a member function process(). This function gets called from several [...]
Maybe I'm behind in the times, but a very clever phish-bot on Steam exists, it takes a friend and copies their profile and avatar so you don't know the difference at a glance.
very sigh. I don't think we can actually start explaining that parallelization works best on a coarser level... Too bad no gets the energy together to actually tell him. Ah well
As a sidenote, I think OpenMP is actually quite good, the way in which it specifies thread teams to be used. That is already a lot less braindead than the usual 'create thread when required' approach found in most roll-your-own threading solutions
@Mysticial Were are you intending to plublish it? SO? Do you have a blarg?
It'd say it's actually pretty much close to done. I might need some better examples though. But it's hard to find anything realistic that isn't too long.
Ok, I'm interested. It could be a CW - or a tag wiki? I can see you'd like to get some rep of it (I assume it will be deserved too) but crowd clique-sourcing it may have it's benefits too
To keep this one from being a "list-type" question and either closed or forced wiki, I'm putting specific examples into the question. Each of those will cover a different area.
@sehe I'll ping you when I'm getting close to posting the FAQ. If you can think of other good examples, I can leave them out of my answer so you can post your own.
I've tried to measure the asymmetric memory access effects of NUMA, and failed.
The Experiment
Performed on an Intel Xeon X5570 @ 2.93GHz, 2 CPUs, 8 cores.
On a thread pinned to core 0, I allocate an array x of size 10,000,000 bytes on core 0's NUMA node with numa_alloc_local.
Then I iterate ...
@Mysticial Those are just the advanced topics... I think the SO audience really needs the bleeding basics laid out. Just simple stuff why doesn't it work to execute int f() { int 42; } in parallel. Why doesn't it work to schedule a 100-iter loop across a theadpool. (Depending of course on the loop body)
@Mysticial I'm not saying they're 'too hard' or something. I'm really saying, they're irrelevant if you look at the basic issues most OpenMP questions are on about, IMO. It's a bit like micro vs. macro. I say, get the macro parallelization right, then do the optimization stuff^.
@Mysticial another way of putting it, your list could be described as micro-optimization issues ('mechanical sympathy') to keep in mind in the context of threading. I was more thinking about a FAQ on the high-level considerations when starting (to design for) parallelization
@sehe I know what you mean. What I'm "trying" to do is to address all the people who try to parallelize (wrongly) a certain way. Then explain why it doesn't work and suggest ways to fix it (possibly at a higher level). But yeah, it's still a WIP. I haven't started running it by other readers yet.
@Mysticial A good example would be, the compiler guy that wrecks build times by parallelizing the compiler backend. However, a build system that builds various modules in parallel will usually benefit more if each module is built in single-threaded fashion.
I tutored college students who were taking a computer programming course. A few of them didn't understand that computers are not sentient. More than one person used comments in their Pascal programs to put detailed explanations such as, "Now I need you to put these letters on the screen." I asked one of them what the deal was with those comments. The reply: "How else is the computer going to understand what I want it to do?"
Apparently they would assume that since they couldn't make sense of Pascal, neither could the computer.
I know you're in there, variable; come out with your hands up. If it wasn't for this pesky object-orientation that's been foisted upon us and that I don't have the time or inclination to get to understand, I'd be able to read and write your variables.
Are you talking to an over-protective class, mate? (<-- pun intended)
@ib. okay, I get the logic. I just think it is contrived :) My point was about readability. In that respect I think :help > :he > :h. Just a friendly note - I think you are awesome vim so, keep up the good work. — sehe3 hours ago
While driving my daily commute, I found his edit/comment on the rote side
I own a computer store. One day, two policemen came into the store and told that they owned a 486 and a 286. They asked if a 486 and a 286 could be assembled together into a 686. I replied to the dumb request by asking them if two 200 horsepower police cars can be used to make up a 400 horsepower Ferrari. The policemen didn't get it and replied angrily that altering car engines is strictly forbidden by law.
"That is not a constructor taking an rvalue, but a constructor taking an rvalue-reference." - I think that the statement the questioner made is way more precise than yours. A function does not "take an rvalue reference" or "take an lvalue reference". It "takes an rvalue" or "takes an lvalue". His constructor can in fact only take rvalues, so his statement was perfectly precise. (And yours wasn't. X && x = ...; foo(x) passes an rvalue reference, but foo won't take it, because it passes it as an lvalue instead of as an rvalue). — Johannes Schaub - litb25 secs ago
Well, I think people also get confused with the fact that an rvalue can easily become an lvalue as soon as you pass it around, then everything breaks :)
The Gripping Hand is a 1993 novel by Larry Niven and Jerry Pournelle. It is a sequel to their multi-award-nominated 1974 work The Mote in God's Eye. The Gripping Hand is, chronologically, the last novel of the CoDominium universe it is set in (though in 2010, Pournelle's daughter released an authorized sequel). In the United Kingdom, it was released as The around Murcheson's Eye (sometimes misspelled "The around Murchison's Eye").
The Gripping Hand revolves primarily around two minor characters of the first book, Captain Sir Kevin Renner (ISN, Reserve) and His Excellency Horace Bury, ...