PIXNET Logo登入

<font face="新細明體"><B>蕭沖的書房</font>

跳到主文

各種知識的象牙塔

部落格全站分類:數位生活

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 1月 17 週四 201313:48
  • Windows Runtime ( WinRT) 的精簡介紹筆記


⓪蕭沖 編著
話說自windows 8開始,在windows 8的應用程式大致上被分為二種: 一種就是「桌機」應用程式,這與過去的應用程式沒什麼大不同。另一種就是Metro-Style App。這種應用程式,目前正式的說法叫「Windows Store App」,因為metro style這個詞有一些法律上的問題。不過為了簡易一點的說明,以下我稱它叫 metro app。
先來說說 metro App 與傳統的desktop應用程式有什麼不同?  我個人覺得最主要的不同在於安全性。metro app與iphone上的app真的超像的,也就是app被局限在一個sandbox裡,不能隨意的存取他人的app或是重要的系統資源,比如說系統的根目錄等。metro app裡的目錄只有三個Local folder、Roaming folder 、Temp folder,因此想搞鬼太不容易,這點若有開發iphone app的人應該可以感受很深!  當然,metro app還有一個很大的不同,那就是外觀(UI),使用windows 8的介面後就會知道不同在哪裡…
ok,以上說了一堆,還是沒講到windows run time :p。總要有個前因嘛! 為了達到 metro app的風格、安全等等,當然相對的windows api就要有所改變,不然如何限制不能讀系統檔之類的,你說是吧?!  metro app 被限制要使用WinRT這個framework(我不稱它是api)來開發。
(繼續閱讀...)
文章標籤

aftcast 發表在 痞客邦 留言(0) 人氣(4,395)

  • 個人分類:Win32
▲top
  • 4月 07 週四 201110:40
  • 我的MP3組裝指令 使用 DOS batch command

⓪著作: 蕭沖
 
這是自己的一個筆記,關於使用dos命令來組裝數個mp3為一個檔。
md tmp
copy ???????c.mp3 tmp\??????? /y
FOR /F "eol=_ tokens=1,2*" %%i in ('dir tmp /AA /B') do copy /b ..\ac.mp3+%%ic.mp3+..\at.mp3+%%it.mp3+..\ae.mp3+%%ie.mp3 A%%i.mp3 && copy /b ..\nc.mp3+%%ic.mp3+..\nt.mp3+%%it.mp3+..\ne.mp3+%%ie.mp3 N%%i.mp3
rd /s /q tmp
(繼續閱讀...)
文章標籤

aftcast 發表在 痞客邦 留言(0) 人氣(251)

  • 個人分類:Win32
▲top
  • 8月 25 週二 200910:04
  • 關於 RichEdit 版本的備忘錄


RichEdit 的版本。




http://blogs.msdn.com/murrays/archive/2006/10/14/richedit-versions.aspx
(繼續閱讀...)
文章標籤

aftcast 發表在 痞客邦 留言(0) 人氣(993)

  • 個人分類:Win32
▲top
  • 12月 11 週四 200802:10
  • Thread-Safe的理解與分析

 
⓪著作: 蕭沖
 
何謂thread-safe? 這個問題我看過許多論壇都有討論過,都總讓人覺得不很滿意。在此,筆者想要用更logical的方式來把議題說清楚。首先,我們要了解它的定義! 定義若都不明白就難以判別安不安全了!
(繼續閱讀...)
文章標籤

aftcast 發表在 痞客邦 留言(7) 人氣(44,318)

  • 個人分類:Win32
▲top
  • 12月 11 週四 200801:51
  • DLL 共享全域變數的議題

⓪編著: 蕭沖
我們知道dll最主要的用途就是在於程式碼共享。而共享的過程中又會演生出全域資料(變數)是否共享的問題。
在多個process間共用同一個dll時,變數的共享與否是靠二個機制:
1/ 不共享全域變數 : 使用copy-on-write的觀念來處理  ( windows 系統自動預設是如此)
2/ 共享全域變數: 我們可以透過把變數放入一個share的segment的記憶體區段內,然後process間就可以共用。
(繼續閱讀...)
文章標籤

aftcast 發表在 痞客邦 留言(2) 人氣(2,560)

  • 個人分類:Win32
▲top
  • 10月 23 週四 200805:24
  • Multithread Pool and Socket Programming Note

⓪編著 :蕭沖
Thread Pool
1/ Create map container of thread data MAY including idle property for later SetEvent, event handle property for Reset event later, thread handle property for close handle later .....by thread id as its key.
2/ Create WorkItem Queue (list for insert priority item or deque for normal queue) data with object,parameter pointer,function pointer.....
3/ Create thread function with thread map container parameter. Impelement function as : get event handler by thread id key from container, WaitForMultipleObjects for handler just get and more utra event handler like shutdown notify. Or using simple semaphore mechanism. Get WorkItem from Queue, and call funtion. Keep looping...
4/ Create threads and insert each thread data into map.
5/ Queue the WorkItem and set event handler for each idle thread in map.
One thread can create its own event object, and be controled after queue work.
Semaphore is a global object, and every thread check it to see if it's count greater than 0,
if yes, then go work, if equal to 0, then keep waiting....
Multithread Socket programming
1/ normal model is after listening imcoming request.... loop for accept call.
2/ accept function is a bloking function, ie, if there's no request, it won't return, for this reason,
process beter create one thread to create server socket and binding and listening....
3/ when accept call returned, it create a new client socket for further communication with client.
4/ create a thread to deal with this new client socket for sending msg or rcv msg....
Traditional model is just like above, it using one thread per connection. and dynamically create thread.
Threads are created and then terminated, cycling....but this may cause taking much overhead.
Using thread pool for deal with client sockets is a good ideal for saving resource.
PS.The other model is using IOCP model for more robust and scalable....
(繼續閱讀...)
文章標籤

aftcast 發表在 痞客邦 留言(0) 人氣(1,596)

  • 個人分類:Win32
▲top
  • 10月 23 週四 200805:23
  • Socket mode Note

⓪編著 :蕭沖
總的來說,Socket 可分為二種模式 : blocking mode, non-blocking mode。
要使socket成為non-blocking mode只要設定ioctlsocket為non-blocking mode就可以,然而,若配合使用了blocking functions,會使得讀/取不到資料時產生WSAEWOULDBLOCK的error。因此若要成功而完整的使用non-blocking mode,就必需配合適當的socket IO models。
Socket I/O 有六種模型:blocking, select, WSAAsyncSelect, WSAEventSelect, overlapped, and completion port。
針對不同的模型,我以一個虛擬的例子來說明: 假設有128條水管可以出水,但每一條出水的時間不同,且有快有慢,若我們的任務是在每一條水管必需各裝3桶水,那麼我們可以達成的方法有:  (人數相當於thread的數量,水管數相當於socket數,水桶相當於傳送或接收的Buffer)
(繼續閱讀...)
文章標籤

aftcast 發表在 痞客邦 留言(2) 人氣(7,759)

  • 個人分類:Win32
▲top
1

自訂側欄

自訂側欄

自訂側欄

大頭貼

aftcast
暱稱:
aftcast
分類:
數位生活
好友:
累積中
地區:

近期文章

  • DELPHI / C++ Builder 使用DDE client時出現亂碼問題
  • XE C++ builder 不能 source debug的原因
  • Windows 7 IE9 IE10 藍畫面 藍屏
  • xcode裡的git (source control->commit)無法成功
  • Windows Runtime ( WinRT) 的精簡介紹筆記
  • verify_signer_identity: Could not copy validate signature: -402620393
  • 我的iphone app --首創電話即時計費與通話警示軟體-電話王
  • CB 當畫面放了許多且很大的圖後無法debug
  • 民國100年5月1日勞動節遇星期日是否該補一天假??
  • open source 的GPL LGPL Apache MIT BSD 等 license 版權的問題 與感染 分析

最新迴響

  • [22/06/09] 路人 於文章「貼2002年文章 : 愛情的烏托邦...」留言:
    愛情烏托邦? 一個只有你跟我不被打擾污染的世界,進去不想被叫...
  • [18/02/23] Peter 於文章「Thread-Safe的理解與分析...」留言:
    您好,想請問讓不安全的thread變安全得第二種方法中, 只...
  • [16/04/18] Ben Chan 於文章「C++中關於extern "C"的意義...」留言:
    THX 大神!...
  • [15/04/30] wefuntw 於文章「C++中關於extern "C"的意義...」留言:
    讚! 大解惑!!! ...
  • [15/03/29] 溫啟清 於文章「Thread-Safe的理解與分析...」留言:
    若什麼是auto變數、stack都還不清楚,推薦閱讀"程式設...
  • [13/12/27] Kristi Huang 於文章「我的iphone app --首創電話即...」留言:
    請問未來是否會更新適用威寶的費率,很期待能使用您開發的APP...
  • [12/06/07] 訪客 於文章「Thread-Safe的理解與分析...」留言:
    很好,很容易理解,淺顯易懂。真厲害!...
  • [11/12/10] 長工老王 於文章「Thread-Safe的理解與分析...」留言:
    那call 副程式,算不算安全呢 ...
  • [11/11/11] EE 於文章「Socket mode Note...」留言:
    這水桶比喻還真的完全的看不懂阿~~~...
  • [10/11/10] RURU 於文章「Thread-Safe的理解與分析...」留言:
    Thread-Safe本身就是一種藝術啊~~~~~~讚!...

文章彙整

文章分類

toggle 電腦維修 (1)
  • 電腦維修 (1)
toggle 軟體程式設計 (7)
  • BCB (15)
  • Win32 (7)
  • C/C++ (7)
  • Assembly (1)
  • Web (1)
  • visual studio c++ (1)
  • iPhone develop (1)
  • IT相關 (1)
  • Life (4)
  • 未分類文章 (1)

部落格文章搜尋

誰來我家

參觀人氣

  • 本日人氣:
  • 累積人氣: