1 初始INIT-Demo运行 按照官网描述 go get 安装框架依赖 # < go 1.16go get -u github.com/TarsCloud/TarsGo/tars/tools/tarsgogo get -u github.com/TarsCloud/TarsGo/tars/tools/tars2go# >= go 1.16go install github.com/
最近要开发一个需求, 涉及到http参数的处理, 我居然还自己去写string到map和map到string的转换, 当看到tc_parsepara后, 深感痛心, 原来, tars的基础库早就实现了这些功能, 来看一下: /*** Tencent is pleased to support the open source community by making Tars availa
tc_readers_writer_data中的代码为: /*** Tencent is pleased to support the open source community by making Tars available.** Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.**
要写一个单例, 很简单。 但是, 如果考虑多线程, 还真不是容易的事, 来看看tc_singleton.h: /*** Tencent is pleased to support the open source community by making Tars available.** Copyright (C) 2016THL A29 Limited, a Tencent com
tc_monitor中的TC_Monitor是线程锁的监控类模板, 通常线程锁,都通过该类来使用,而不是直接用TC_ThreadMutex、TC_ThreadRecMutex 来看看源码: /*** Tencent is pleased to support the open source community by making Tars available.** C
tc_thread_rwlock里面的类TC_ThreadRWLocker是对读写锁操作的封装。 而读写锁, 是linux中非常基本的概念, 在某次面试的时候, 我还被问到过。 来看看: /*** Tencent is pleased to support the open source community by making Tars available.** Cop
这个文件很简单, 来看下: /*** Tencent is pleased to support the open source community by making Tars available.** Copyright (C) 2016THL A29 Limited, a Tencent company. All rights reserved.** Licensed unde