Guest:
Register
|
Login
|
Member List
|
Search
|
Statistics
|
FAQ
Language
----------
Simplifed Chinese
Traditional Chinese
English
CnPack Forum
»
技术板块灌水区
» 多线程同步处理问题!
‹‹ Last Thread
|
Next Thread ››
Poll
Trade
Reward
Activity
Printable Version
|
Email to Friend
|
Subscription
|
Favorites
Subject: 多线程同步处理问题!
linio
新警察
UID 7020
Digest Posts 0
Credits 5
Posts 3
点点分 5
Reading Access 10
Registered 2007-3-9
Location 浙江台州
Status Offline
#1
Post at 2007-3-21 09:32
Profile
|
Blog
|
P.M.
|
多线程同步处理问题!
实现目的:软件的自动升级
描述:我用Socket做了一个软件的自动升级,是C/S模式的,当S端打开时,运行C端可以检测是否需要升级,但同一时间只能升级一个客户端程序,现在想用多线程模式解决这个问题,初步想法是,每一个客户端提交升级请求后,服务器端自动创建一个线程,独立处理该客户端的升级,也就是说,一个线程对应一个客户端,不知道能否用Cnpack里的cnThreadPool实现,如何实现?
注:我是初次接触多线程同步处理的问题,请朋友们不吝赐教!
kendling
(小冬)
高级版主
MyvNet
UID 703
Digest Posts
5
Credits 978
Posts 580
点点分 978
Reading Access 101
Registered 2005-2-18
Location 广东
Status Offline
#2
Post at 2007-3-21 09:43
Profile
|
Site
|
Blog
|
P.M.
|
|
TCnThreadPool是线程池。多线程不一定要用他。
小冬
http://MyvNet.com
Passion
(LiuXiao)
管理员
UID 359
Digest Posts
19
Credits 6838
Posts 3591
点点分 6838
Reading Access 102
Registered 2004-3-28
Status Offline
#3
Post at 2007-3-21 10:16
Profile
|
Blog
|
P.M.
照你的需求来说,确实不需要用池。独立创建线程并管理就行了。
zzzl
(早安的空气)
版主
UID 590
Digest Posts 0
Credits 399
Posts 199
点点分 399
Reading Access 100
Registered 2004-11-29
Status Offline
#4
Post at 2007-3-22 08:55
Profile
|
Blog
|
P.M.
|
你照indy的例子抄点代码就实现了,indy替你开线程了
linio
新警察
UID 7020
Digest Posts 0
Credits 5
Posts 3
点点分 5
Reading Access 10
Registered 2007-3-9
Location 浙江台州
Status Offline
#5
Post at 2007-3-22 10:21
Profile
|
Blog
|
P.M.
|
谢谢,没接触过,所以不会,呵呵
我试试看吧
kendling
(小冬)
高级版主
MyvNet
UID 703
Digest Posts
5
Credits 978
Posts 580
点点分 978
Reading Access 101
Registered 2005-2-18
Location 广东
Status Offline
#6
Post at 2007-3-28 12:00
Profile
|
Site
|
Blog
|
P.M.
|
|
哈哈,用TList管理线程就行了。
小冬
http://MyvNet.com
Poll
Trade
Reward
Activity
CnPack Forum
CnPack English Forum
> CnWizards IDE Wizards
> CVSTracNT
> Announcements & Others
All times are GMT++8, the time now is 2024-11-22 07:18
Powered by
Discuz!
5.0.0
© 2001-2006
Comsenz Inc.
Processed in 0.008007 second(s), 7 queries , Gzip enabled
TOP
Clear Cookies
-
Contact Us
-
CnPack Website
-
Archiver
-
WAP
Member's CP Home
Edit Profile
Credits Transaction
Public User Groups
Buddy List
Main
Page Views
User Agents
Posts History
Top Forums
Top Threads
Post Ranking
Credit Ranking
Online Time
Team
Moderation Stats