由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - 怎么synchronize时间捏
相关主题
发现 synchronized 的一个问题HashMap cache
synchronization for countersApply lock on a class.
synchronization 锁住了什么?问一个基础问题
新手问个multi-threading关于synchronized和volatile的问题请教:performance issue
问一个lock的puzzle请教:怎么把synchronize的method改成用thread 但thread safe呢?
如何让两个socket并行执行threadjava的volatile
Talk a little more about How to lock a fileJava concurrency的疑惑,难道我理解错了? (转载)
请教一个多线程lock机制的问题Re: Question: Java Synchronization
相关话题的讨论汇总
话题: service话题: db话题: server话题: web
进入Java版参与讨论
1 (共1页)
k***r
发帖数: 4260
1
有几台机器在不同的data center,需要比较准时地在整点向服务器
报告,前后差一两分钟问题不大。但是本机的时间不能保证,而且
不能调整,只能在Application起来的时候从网上拿一个比较准的时
间而不依赖系统时间。有什么NTP component推荐吗?或者有什么
free的报告时间的web service?
k***r
发帖数: 4260
2
找到一个webservice,奇怪的是getUTCTime只返回时间没有日期
http://www.nanonull.com/TimeService/TimeService.asmx
g*****g
发帖数: 34805
3
Counting on external web service for a task like this is a
bad idea. You may get system time from the same DB server and
most DB servers support that.

【在 k***r 的大作中提到】
: 有几台机器在不同的data center,需要比较准时地在整点向服务器
: 报告,前后差一两分钟问题不大。但是本机的时间不能保证,而且
: 不能调整,只能在Application起来的时候从网上拿一个比较准的时
: 间而不依赖系统时间。有什么NTP component推荐吗?或者有什么
: free的报告时间的web service?

m******t
发帖数: 2416
4
Why not just put ntpdate in a cronjob?

【在 k***r 的大作中提到】
: 有几台机器在不同的data center,需要比较准时地在整点向服务器
: 报告,前后差一两分钟问题不大。但是本机的时间不能保证,而且
: 不能调整,只能在Application起来的时候从网上拿一个比较准的时
: 间而不依赖系统时间。有什么NTP component推荐吗?或者有什么
: free的报告时间的web service?

F****n
发帖数: 3271
5
Try to separate clock synchronization and program synchronization. On each
workstation install a timer synchronized to a timer service. Use the local
timer to synchronize local program.

【在 k***r 的大作中提到】
: 找到一个webservice,奇怪的是getUTCTime只返回时间没有日期
: http://www.nanonull.com/TimeService/TimeService.asmx

k***r
发帖数: 4260
6
A mix of unix and Windows machines makes it a little messy.
Plus, I'm not supposed to touch the local clock.

【在 m******t 的大作中提到】
: Why not just put ntpdate in a cronjob?
k***r
发帖数: 4260
7
In my case, the DB server isn't exposed. Although I can
provide a web service to wrap the DB time but I'm assuming
using an external web service is even easier, unless it's
not reliable...

【在 g*****g 的大作中提到】
: Counting on external web service for a task like this is a
: bad idea. You may get system time from the same DB server and
: most DB servers support that.

g*****g
发帖数: 34805
8
If it's not a paid service with 99.9% guarranteed up time,
it's not reliable. Anything can break will break.
If it's a critical service for the product and you can't
deliver because a free service you happen to find on Internet
is broken. You'll look very bad.
And I don't get that the DB Server isn't exposed. Can't you
get it through SQL query although it may vary from vendor to
vendor.

【在 k***r 的大作中提到】
: In my case, the DB server isn't exposed. Although I can
: provide a web service to wrap the DB time but I'm assuming
: using an external web service is even easier, unless it's
: not reliable...

k***r
发帖数: 4260
9
The reliability of a free service is a concern.
Using a time web service provided by my server is probably
a good idea - it needs to report to my server anyway. Just
a little bit more work to do.
Thanks for the suggestions!

【在 g*****g 的大作中提到】
: If it's not a paid service with 99.9% guarranteed up time,
: it's not reliable. Anything can break will break.
: If it's a critical service for the product and you can't
: deliver because a free service you happen to find on Internet
: is broken. You'll look very bad.
: And I don't get that the DB Server isn't exposed. Can't you
: get it through SQL query although it may vary from vendor to
: vendor.

g*****g
发帖数: 34805
10
It's a DB server, why can't you use oldschool SQL query to get it,
web service sounds overkill for me.

【在 k***r 的大作中提到】
: The reliability of a free service is a concern.
: Using a time web service provided by my server is probably
: a good idea - it needs to report to my server anyway. Just
: a little bit more work to do.
: Thanks for the suggestions!

k***r
发帖数: 4260
11
Let's say, the servers that need to report back are on customers'
sites and the only interface for it to ping home is HTTP.
By web service I meant it in a generic way. It could be a web
page that simply prints out "11/19/2008 18:24:30".

【在 g*****g 的大作中提到】
: It's a DB server, why can't you use oldschool SQL query to get it,
: web service sounds overkill for me.

r*****l
发帖数: 2859
12
Is there an operation team in your company that
maintenance the machine and the OS?
It's ops responsibility to make the server time
accurate.

【在 k***r 的大作中提到】
: A mix of unix and Windows machines makes it a little messy.
: Plus, I'm not supposed to touch the local clock.

r*****l
发帖数: 2859
13
And have Java read the local time.

【在 r*****l 的大作中提到】
: Is there an operation team in your company that
: maintenance the machine and the OS?
: It's ops responsibility to make the server time
: accurate.

k***r
发帖数: 4260
14
Some of the machines belong to, let's say, some
customers, that don't guarantee to keep up the time
on the servers. So I can't rely on local time...

【在 r*****l 的大作中提到】
: Is there an operation team in your company that
: maintenance the machine and the OS?
: It's ops responsibility to make the server time
: accurate.

1 (共1页)
进入Java版参与讨论
相关主题
Re: Question: Java Synchronization问一个lock的puzzle
Re: How to lock a file and detect a thread is over?如何让两个socket并行执行thread
List, LinkedList and VectorTalk a little more about How to lock a file
java 程序中的实时控制请教一个多线程lock机制的问题
发现 synchronized 的一个问题HashMap cache
synchronization for countersApply lock on a class.
synchronization 锁住了什么?问一个基础问题
新手问个multi-threading关于synchronized和volatile的问题请教:performance issue
相关话题的讨论汇总
话题: service话题: db话题: server话题: web