一直收藏着
laok的blog ,讲基金的blog,还知道他有一本《我的投资观和实践》,想着有一天要买基金了就好好研究一下的。
今天没事的时候翻了几篇,看着看着有了感觉,最后忍不住就手痒去招行实践了一把,于是我就这么也成为了“基民”。
看过的几篇做个笔记:
- 1,该把多少存款用来投资?
年龄越大越应该保守
建议:30岁,30%的资产,各种投资不超过70%;40岁,储蓄40%,投资60%;60岁,储蓄60%,投资40%。
这个意见基本上和《奔奔族理财》意见一致,也很合理。
- 3, 第一只基金买甚么?
建议第一只基金去买货币基金。 货币基金再怎么买也不会有损失
- 首先取决于你的风险承受能力和你准备投资的年限,先要确定投资甚么基金品种;
- 再确定是哪个公司的哪种基金。选择晨星评级至少4星以上的;
- 不能以短时间论英雄;三个月,甚至半年以内的排位我认为没有任何意义。
指数基金不推荐,因为中国市场不够规范(美国的市场基本上是有效的,但中国的市场恐怕连半有效市场都不是)
新基金不是个好选择;老牌基金公司下的老牌劲旅基金恐怕是一个好选择
- 5,关于基金定投
我采用的是一次性投入和定投结合的办法。
当我第一次把银行的存款投入基金的时候,我基本采用的是一次性投入(实际上我是在较短的时间分批投入的,这样降低偶然涨跌影响)。
而后来每个月的结余工资是采用定投的方式来存养老金。
定投最大的好处实际上是心理上的。
定投就可以逼迫你克服你的贪婪。这是一种强制性的非常有纪律性的投资方式,别去考虑股市的涨跌,也不要试图抓住这种涨跌。
要注意严格的投资纪律性在投资上是非常重要的。
嗯,定投是很合理的选择啊,虽然波段的诱惑很大。。。
- 13,我为什么选择广发和上投
评价一个基金公司的好坏,可以看他所有的基金的平均水平。
主要参考某家基金公司所有产品在晨星的评级,如果多数是5星的基金品种,说明这家基金公司整体水平不错。
感觉和taobao上挑卖家差不多。。。
- 31,再说定投
一个模拟的例子说明定投收益最终好于一次性投入
英文中定投称为dollar-cost average方法
如果你要长期投资,按照普遍的认为,大盘是长期向上的,在这个向上的趋势上有很多短期的波动。那定投实际上就是平滑了这种波动,最后得到一个平均效益。
定投不是最好的长期投资方案,但如果你没有那么多资金进行一次性投资,例如你是从每个月的收入中提取一部分,定投则是非常好的选择。
无论市场是牛是熊还是猴,定投都是一个不错的办法,这是我的观念。
- 15,给基金新手的一些建议
推荐:基金投资入门系列贴汇总【新手必读】
这篇还没看完,蛮系统的介绍了入门,这个以后回来重读。。。
另外提到的这篇入门贴,重点看了里面介绍货币基金的部分。总之货币基金就是风险小回报小,基本可以用来代替存款的东西吧
其余的翻了几篇,有涉及到技术/数字分析方面的,没仔细推敲。一方面也是看了上面的几篇已经心痒痒了,呵呵
于是照搬了几条意见,去招行还有晨星逛了逛,最后就选定了
嘉实货币 这只。主要是:
- 肯定选一只货币基金;另外现在股票市场还太混乱,看不清,感觉货币基金也稳妥些。
- 投入不多,不超过所有资金的1/5
- 看了嘉实的其他基金品种,蛮多在晨星达到了5星的评价
- 不是收益最高的,但晨星对它去年的评价也不错,而且查看了近几周排名,都排在货币基金的第一位。
- 晨星对嘉实货币去年收益的排名是第二,第一是中信现金优势,不过招行不能买;中信现金优势似乎也不错,值得关注
以后考虑:
- 再仔细研究一些基金知识,同时切身体会一下操作基金的感觉
- 重点考虑定投一到两只股票型基金,毕竟现在的股市那么低,反弹空间诱人啊~
- 财帮子网看上去还不错,或者要找一个同类的工具型网站,最好也能包括股市投资记录的
search: this is where all story begins
gmail: daily use, just another legend
docs: AWESOME! makes doc not just doc
toolbar for Firefox: some great tools to make Firefox even greater
reader: now part of my life, to let me know what's happening around
translate: not accurate, but always help
blog search: specific tool for specific use
notebook: just not suitable for me
calendar: reminding-SMS is really useful, pity that i'm not always a scheduled person
gtalk: simple and clean. great backup for MSN, though not a replacement yet
picasa: offline tool + online holding. perfect match
blogger: really convenient when combining with google docs; really suck when being blocked by GFW!
mobile: reader, search, map... just give me more!
YouTube: not really so atractive among tons of copiers
iGoogle: not so atractive either, sorry, i prefer classic google homepage
page creator: to build a personal web page is always my dream, but...残念
desktop search: great idea, but hey guys, you can do better
code: for specialists, seems to be better than sourceforge, we'll see...
SketchUp: not really used, but really interested of this move direction
gadget and
OpenSocial: these guys make Javascript so sexy!
earth: thanks for offering a free tour of world
My top 5Search Gmail Docs Talk btw: I just feel like to speak some english after watching "how i met ur mother", anyway...
http://www.boost.org/doc/libs/1_35_0/doc/html/thread/synchronization.html Mutex概念线程同步最基本的是mutex(mutual exclusion的缩写)。一个互斥体一次只允许一个线程访问共享区。当一个线程想要访问共享区时,首先要做的就是锁住(lock)互斥体。如果其他的 线程已经锁住了互斥体,那么就必须先等那个线程将互斥体解锁,这样就保证了同一时刻只有一个线程能访问共享区域。
Boost.Thread supplies
recursive and
non-recursive mutexes with
exclusive ownership(独占) semantics, along with a
shared ownership (共享) (multiple-reader / single-writer) mutex.
Boost.Thread supports four basic concepts for lockable objects:
Lockable
,
exclusive ownership
TimedLockable
,
SharedLockable
,
This is the standard multiple-reader / single-write model:
at most one thread can have exclusive ownership, and if any thread does have exclusive ownership, no other threads can have shared or exclusive ownership. Alternatively, many threads may have shared ownership.
UpgradeLockable
,
This is an extension to the multiple-reader / single-write model provided by the
SharedLockable
concept:
a single thread may have
upgradable ownership at the same time as others have
shared ownership. The thread with
upgradable ownership may at any time attempt to upgrade that ownership to
exclusive ownership. If no other threads have shared ownership, the upgrade is completed immediately, and the thread now has
exclusive ownership, which must be relinquished by a call to
unlock()
, just as if it had been acquired by a call to
lock()
.
[注:除Lockable的mutex外,其余的各种复杂mutex还需要更多代码实践]
Each mutex type implements one or more of these concepts, as do the
various lock types.
Lock Typesboost定义的Lock types为class template,以合适的Lockable object作为模板参数
lock_guard
- RAII-style的简单lock,在ctor中lock,在dtor中unlock
只支持简单的Lockable
object
unique_lock
- 比
lock_guard
复杂在:不仅提供RAII-style的lock,还允许用户指定是否在ctor中立即lock,意味着可以指定推迟lock(defer acquiring the lock,通过指定defer_lock_t参数),直到显式调用其lock()方法
还支持TimedLockable
concept,前提是需要lock的Lockable object本身支持
The member functions of boost::unique_lock
are not thread-safe...[注:这句没看懂。。。]
shared_lock
upgrade_lock
upgrade_to_unique_lock
- [注:目前只用过unique_lock。后面几种对应于不同需求的lock,从名字就可以直观看出功能,还未试验,直接参考api]
Mutex TypesMutex types对应于之前的mutex concepts,目前有:
适用于不同需求
Condition Variables The general usage pattern is that one thread locks a mutex and then calls
wait
on an instance of
condition_variable
or
condition_variable_any
. When the thread is woken from the wait, then it checks to see if the appropriate condition is now true, and continues if so. If the condition is not true, then the thread then calls
wait
again to resume waiting.(
中文参考)
lock
is passed to
wait()
;
wait()
will
atomically add the thread to the set of threads waiting on the condition variable, and
unlock the mutex. When the thread is woken, the mutex will be
locked again before the call to
wait
returns. This allows other threads to acquire the mutex in order to update the shared data, and ensures that the data associated with the condition is correctly synchronized.
In the mean time, another thread sets the condition to true
, and then calls either notify_one()
or notify_all()
on the condition variable to wake one waiting thread or all the waiting threads respectively.
condition_variable_any比condition_variable更通用;condition_variable要求传给wait()的必须是
boost::unique_lock<boost::mutex>类型;
condition_variable一般更优化
One-time Initialization仅运行一次的例程
http://www.stlchina.org/twiki/bin/view.pl/Main/BoostThread#5%20%BD%F6%D4%CB%D0%D0%D2%BB%B4%CE%B5%C4%C0%FD%B3%CC
[注:还未使用过]
Barriers[注:还未使用过]
线程局部存储(中文说明) (
Another one )
典型的应用场景是errno。
Boost线程库提供了智能指针boost::thread_specific_ptr来访问本地存储线程。是跨平台的解决方案
http://www.boost.org/doc/libs/1_35_0/doc/html/thread/thread_local_storage.html [注:还没有实践过,等写过相应代码后再来补充文档]
http://www.boost.org/doc/libs/1_35_0/doc/html/thread/thread_management.html launching threads boost::thread类代表一个可执行的线程(thread of execution)。
A new thread is launched by
passing an object of a callable type that
can be invoked with no parameters to the constructor.
The object is then copied into internal storage, and invoked on the newly-created thread of execution.
If you wish to construct an instance of
boost::thread with a function or callable object that
requires arguments to be supplied, this can be done using
boost::bind.
(thread non-copiable, but movable; object that used to created a thread must callable, if not, use boost::ref)
Joining and detaching
当代表一个可执行的线程(
thread of execution)的boost::thread对象被销毁时,这个线程便同时被
detached. Detached的线程将继续运行直到线程终止。
也可以显式调用(explicitly)一个boost::thread对象的detach()方法,这时这个线程直接被detach,而这个boost::thread对象讲不再代表thread of execution,而指
Not-a-Thread
join()用于等待一个线程结束。
(timed_join())
Interruption 调用boost::thread对象的
interrupt()方法,可以中断其对应的线程。
When the interrupted thread next executes one of the specified
interruption points (or if it is currently blocked whilst executing one) with interruption enabled, then a boost::thread_interrupted exception will be thrown in the interrupted thread. If not caught, this will cause the execution of the interrupted thread to terminate. As with any other exception, the stack will be unwound, and destructors for objects of automatic storage duration will be executed.
(boost::this_thread::disable_interruption,
Predefined Interruption Points)
Thread IDs
每一个运行中的thread都有一个唯一的id值。
调用对应的
boost::thread对象的
get_id()方法
,或者在运行的thread中调用
boost::this_thread::get_id()
方法。
Namespace this_thread this_thread下包含的是在正在运行的线程内部,所能进行的线程操作,包括上面提到的get_id()方法
http://www.boost.org/doc/libs/1_35_0/doc/html/thread/thread_management.html#thread.thread_management.this_thread Thread Groupthread_group class provides for a collection of threads that are related in some fashion.
New threads can be added to the group with
add_thread and
create_thread member functions.
thread_group is
not copyable or movable.
基础概念:
参考:
- http://www.cs.cf.ac.uk/Dave/C/node32.html
一个c/pthread的thread教程,有一些典型例子的代码、算法说明
- http://www.stlchina.org/twiki/bin/view.pl/Main/BoostThread#C++%20Boost%20Thread%20%B1%E0%B3%CC%D6%B8%C4%CF
C++ Boost Thread 编程指南(中文版)
http://www.ddj.com/cpp/184401518
英文原版
WARNING:Out-of-Date(2002年的)! 只能参考用
- http://aszt.inf.elte.hu/~gsd/klagenfurt/material/ch03s06.html
英文的一篇boost.thread说明,里面有boost::thread的简单例子,其中一个使用了condition
WARNING:Out-of-Date! 只能参考用
Code: