Red Baron

SEARCH RESAULT : 글 검색 결과 - Program (총 14개)

POST : Program

시간이 나는대로 보자

재밌을거 같은 내용이다 시간은 좀 걸리듯 하고
....
http://www.codeproject.com/cpp/reversedisasm.asp
top

posted at

2007. 1. 19. 21:14


POST : Program

DB POOL[WIN32]

다중 쓰레드 상에서 데이터 베이스 커넥션 풀을 구현 하기 위해서
여러가지 락을 사용할수 있지만 IOCP모델등에 병합하기 위해 아래와
같은 쓰레 구현을 사용하였다.
인터페이스는 아래와 같다.


주의 해야 할점은 Get/Release 상황에서 Locking / Unlocking에 대한 이해 부분이다.
쓸모 없이 Lock/Unlock을 남발하여 리소스를 낭비 할수 있기 때문에

구현에서는 다중 뮤텍스락에 대해 WaitForMultipleObjects을 사용하였다.

Get/Release 코드는 아래와 같다.

Get

Wait 상황에서 리턴되는 값의 Valid함을 보장하고 그 값에서 해당 뮤텍스를 리턴 하도록 한다.

Release

Release를 하는 경우 해당 뮤텍스를 릴리즈 하여 대기중인 쓰레드에게 해당 뮤텍스에 대한 권한을 승계 하도록 만든다.

만일 뮤텍스의 값에 널값을 넣거나 게 되면 WaitForMultipleObjects에서 에러가
발생 하게 되므로 주의 하도록 한다.
top

posted at

2007. 1. 12. 13:39


POST : Program

View Error Code

출처 : MSDN - View Error Code

윈도 프로그래밍 시 가끔 오류 번호 일일이 확인 하기가 귀찮을때..
사용

top

posted at

2007. 1. 11. 10:05


POST : Program

lisp study1

(defun make-cd (title artist rating ripped)
  (list :title title :artist artist :rating rating :ripped ripped))

(defvar *db* nil)

(defun add-record (cd) (push cd *db*))

(defun dump-db ()
  (dolist (cd *db*)
  (format t "~{~a:~10t~a~%~}~%" cd)))

(defun prompt-read (prompt)
  (format *query-io* "~a: " prompt)
  (force-output *query-io*)
  (read-line *query-io*))

(defun prompt-for-cd()
  (make-cd
  (prompt-read "Title")
  (prompt-read "Artist")
  (or (parse-integer (prompt-read "Rating") :junk-allowed t) 0)
  (y-or-n-p (prompt-read "Ripped [y/n]:"))))

(defun add-cds()
  (loop (add-record (prompt-for-cd))
(if (not (y-or-n-p "Another? [y/n]: ")) (return))))


-. list --> macro for list strucrure

-. (list :title title :artist artis)
   :<- make index for data

-. ~is likely % from printf in C
-. or make not null to input data that is null ,and make default value of 0
-. y-or-n-p make constraint to input y or n (common lisp function)


top

posted at

2006. 12. 10. 22:37


POST : Program

ping program

//제작은 제가 한거 같은데...어디서 참고를 한건지는 기억이 잘..-_-;;

//쓰실때 출처는..코멘트를 해주세요.....흐..

//아마도 제가 기억하기로는 linux source쪽에서 가져 온거로 알고 있습니다..

//모 거의 모든 부분이 linux source쪽 그대로지 않나 싶네요..

//수정한 부분이 있긴 있을텐데..기억이 잘 안나네요..2년전에 작성한거라서리..-_-;;


top

posted at

2006. 12. 9. 14:38


CONTENTS

Red Baron
BLOG main image

RSS 2.0Tattertools
공지 아카이브
최근 글 최근 댓글 최근 트랙백
카테고리 태그 구름사이트 링크