빌더에서 지원하는 VCL Thread를 사용해보시기 바랍니다.
팁&트릭란에 임프님의 올려주신 기초적인 사항이 있습니다. 보시면 도움이 될것입니다.
http://cbuilder.borlandforum.com/impboard/impboard.dll?action=read&db=bcb_tip&no=36
조금만 찾아보시면 많은 도움이 될만한 내용들이 있구요...
그리고 밑의 DB 프로그래밍을 물어보신 분께도 권해드린 내용이지만, 강좌/문서란의 한글 빌더 매뉴얼이 있습니다. 이 매뉴얼의 쓰레드 프로그래밍쪽도 함께 참고해보시기 바랍니다.
그럼..
RedEye 님이 쓰신 글 :
: 아래 문장은 도움말에 나오는 사항인데요~.
:
: 제 컴푸터 OS는 2000쓰고 있고여,
:
: _beginthread로 시작해서 _end thread로 끝낼려면 어떻게 해서 사용해야되는지 이해 않가요~ ㅜㅜ
:
: Prototype
:
: unsigned long _beginthread(void (_USERENTRY *__start)(void *), unsigned __stksize, void *__arg);
:
: void _endthread(void);
:
: 그리고 아직 초보라 원형만 보고 프로그램하기가 힘드네요~ 보통 원형을 보고 어떻게 쉽게 이해할수있나요?
:
: 스레드의 시작과 끝을 적용해서 여러게의 펑션을 구동시켜 보고 싶습니다.
:
: 도와주세요~
:
:
:
:
: /* Use the -tWM (32-bit multi-threaded target) command-line switch for this example */
:
: #include <stdio.h>
: #include <errno.h>
: #include <stddef.h> /* _threadid variable */
: #include <process.h> /* _beginthread, _endthread */
: #include <time.h> /* time, _ctime */
:
: void thread_code(void *threadno)
: {
: time_t t;
:
: time(&t);
: printf("Executing thread number %d, ID = %d, time = %s\n",
: (int)threadno, _threadid, ctime(&t));
:
: }
:
:
: void start_thread(int i)
: {
: int thread_id;
:
: #if defined(__WIN32__)
: if ((thread_id = _beginthread(thread_code,4096,(void *)i)) == (unsigned long)-1)
: #else
: if ((thread_id = _beginthread(thread_code,4096,(void *)i)) == -1)
: #endif
: {
: printf("Unable to create thread %d, errno = %d\n",i,errno);
: return;
: }
: printf("Created thread %d, ID = %ld\n",i,thread_id);
: }
:
: int main(void)
: {
: int i;
:
: for (i = 1; i < 20; i++)
:
: start_thread(i);
: printf("Hit ENTER to exit main thread.\n");
: getchar();
: return 0;
: }