병렬 프로그램을 만드는 3단계
1. 병렬처리가 가능한 작은 단위로 문제를 쪼개고
2. 각 단위 문제를 프로세서에 나눠주고
3. 병렬 프로세서간의 통신과 동기화를 시키자
병렬프로그래밍의 대부분은 데이터 간의 의존을 명확하게 하는 것이다.
병렬 프로그램을 만드는 3단계
1. 병렬처리가 가능한 작은 단위로 문제를 쪼개고
2. 각 단위 문제를 프로세서에 나눠주고
3. 병렬 프로세서간의 통신과 동기화를 시키자
병렬프로그래밍의 대부분은 데이터 간의 의존을 명확하게 하는 것이다.
/를 이용해서 찾았던 단어, :s나 :g를 이용해 바꿀때는 그냥 비우면 돼.
Ctrl-r Ctrl-w하면 현재 커서의 단어가 명령어라인으로 카피된다.
Press/
then Ctrl-r then Ctrl-w to copy the current word to the command line. You can now edit the search pattern and press Enter. Use Ctrl-r Ctrl-w for a <cword>, or Ctrl-r Ctrl-a for a <cWORD>.
After searching, an empty search pattern will repeat the last search. This works with /
, :s
and :g
.
So, after searching for a word, use :%s//new/g
to change all occurrences to 'new', or :g/
to list all lines containing the word. See substitute last search
:g/^baz/s/foo/bar/g
Change each 'foo' to 'bar' in each line starting with 'baz
:'a,'bs/foo/bar/g
Change each 'foo' to 'bar' for all lines from mark a to mark b inclusive.
Save typing by using \zs
and \ze
to set the start and end of a pattern. For example, instead of:
:s/Copyright 2007 All Rights Reserved/Copyright 2008 All Rights Reserved/
Use:
:s/Copyright \zs2007\ze All Rights Reserved/2008/