본문 바로가기
반응형

쓰레드7

Go 루틴 (goroutine) 1. Go rountine Go routine은 Go 런타임이 관리하는 Lightweight 논리적 (혹은 가상적) 쓰레드(1이다. Go에서 “go” 키워드를 사용하여 함수를 호출하면, 런타임시 새로운 go routine을 실행한다. go routine은 비동기적으로(asynchronously) 함수루틴을 실행하므로, 여러 코드를 동시에(Concurrently) 실행하는데 사용된다. 동시성을 제공하고 있다. go routine의 특징 - 비동기 - 동시성 (1 go routine은 OS 쓰레드보다 훨씬 가볍게 비동기 Concurrent 처리를 구현하기 위하여 만든 것으로, 기본적으로 Go 런타임이 자체 관리한다. Go 런타임 상에서 관리되는 작업단위인 여러 go routine들은 종종 하나의 OS 쓰레드.. 2021. 8. 23.
go 채널을 사용하는 좋은 예제 go channel을 사용하는 좋은 예제 이 코드에서는 go channel을 exit할 수 있는 예제가 포함되어 있습니다. 기본적인 예제 중 select 문을 사용해서 채널값을 받게 되면 루틴을 종료하는 예제입니다. 이 기본 go channel을 사용하는 design pattern 만 알고 있으면 대부분을 고 채널을 사용할 때 응용할 수 있습니다. var quit chan struct{} func startLoop() { quit := make(chan struct{}) go loop() } func stopLoop() { // As mentioned by Kaedys //close(quit) // permits signalling everyone havins such a `case 2021. 8. 19.
[delphi] Thread를 이용하여 ProgressBar 그리기 [delphi] Thread를 이용하여 ProgressBar 그리기 2003.12.16 http://www.swissdelphicenter.ch/torry/showcode.php?id=1887...paint a moving progress bar using a background thread? Author: P. Below 1 Comment to this tip [Write new comment] [ Print tip ] Tip Rating (6): { Question: I am trying query to display records in a dbgrid.however, due to size of tables and joins takes a while for the query to Execute.is .. 2016. 7. 16.
[개발/MFC] Thread, Process ID & Handle Thread, Process ID & Handle 윈도우즈용 응용프로그램, ActiveX, DLL, Windows Service 등을 만들기 위해서 알아두어야 할 기본적인 지식들 출처 : http://radrome.springnote.com/pages/2213794 윈도우, 프로세스, 모듈 - 핸들, ID, 파일이름 파일이름 만으로 전체 경로 얻기 GetFullPathName( sFileName, _MAX_PATH, sFullFull, 0); -> 문제 : 현재 경로에 파일름만 붙인다. GetFullPath()(만듬) : 파일일 현재 실행된 파일의 경로에 있는 검사해서 붙인다. * 윈도우 윈도 Instance : (SDK) GetWindowLong(hWndCur, GWL_HINSTANCE), (MFC)H.. 2012. 9. 25.
[개발/delphi] Thread 사용 예제 Thread 사용 예제.... 몇가지 유의할 점들을 기억해두자.기본적인 내용들이지만 잊어버리고 에러를 만들어내는 우리들 개발자들이다.... 항상 되새김질을하자. 출처: 인터넷 //// Thread class 정의 예제//unit RainbowThread;interfaceuses Classes, SysUtils, ExtCtrls;type TRainbowThread = class(TThread) private { Private declarations } FShape : TShape; protected procedure Execute; override; public Constructor Create(Shape:TShape); end;implementation{ TRainbowThread }procedure T.. 2012. 9. 4.
[개발/MFC] Thread, Process ID & Handle 윈도우즈용 응용프로그램, ActiveX, DLL, Windows Service 등을 만들기 위해서 알아두어야 할 기본적인 지식들 출처 : http://radrome.springnote.com/pages/2213794 윈도우, 프로세스, 모듈 - 핸들, ID, 파일이름 파일이름 만으로 전체 경로 얻기 GetFullPathName( sFileName, _MAX_PATH, sFullFull, 0); -> 문제 : 현재 경로에 파일름만 붙인다. GetFullPath()(만듬) : 파일일 현재 실행된 파일의 경로에 있는 검사해서 붙인다. * 윈도우 윈도 Instance : (SDK) GetWindowLong(hWndCur, GWL_HINSTANCE), (MFC)HINSTANCE AfxGetInstanceHandl.. 2011. 4. 19.
반응형