随笔分类 -  Go

on the go way (six)the usage of select which prevent form blocking
摘要:when used the select word ,sometimes it may be blocked ,we can use the timer to prevent form being blocking which used as follows: 阅读全文

posted @ 2016-03-23 12:01 AAAAAApple 阅读(267) 评论(0) 推荐(0)

on the go way (五)git push 403 error
摘要:在使用git push的时候产生这种情况 error: The requested URL returned error: 403 while accessing https://github.comgit/info/refs 阅读全文

posted @ 2016-03-22 20:32 AAAAAApple 阅读(108) 评论(0) 推荐(0)

on the go way (四)select 的用法
摘要:在channel 和gorutine的联合使用中,select的结合使用也越来越多 阅读全文

posted @ 2016-03-22 16:22 AAAAAApple 阅读(204) 评论(0) 推荐(0)

on the go way (三)channel 的用法
摘要:3)关闭无缓存的channel不会阻塞 对于关闭的channel 没有buffer的channel 读出来的为对应的0值,但如果往里面写数据的话会产生panic 4)关闭有缓存的channel 关闭之后可以读出来~但是写入还是引发panic 5)nil channel发生阻塞 阅读全文

posted @ 2016-03-22 15:09 AAAAAApple 阅读(275) 评论(0) 推荐(0)

on the go way (二)channel 的用法
摘要:在Go语言中channel的使用方法有很多,首先来看以下的使用方法 1)当作事件信号来用,当某一件事完成之后,通知另一件事的完成 2)多个线程同时进行 阅读全文

posted @ 2016-03-22 14:01 AAAAAApple 阅读(438) 评论(0) 推荐(0)

on the go way (一)服务器并发
摘要:服务器并发的方式有很多种 1.通过多进程或者多线程的方式,现在这种模式基本上已经不用 2.epoll和IOCP回调的方式,不符合人们的习惯 3.使用协程(轻量级线程,创建、销毁的代价很小),协程在逻辑上上顺序执行 其中属于erlang和golang在协程并发方面做的比较好 package maini 阅读全文

posted @ 2016-03-21 11:43 AAAAAApple 阅读(216) 评论(0) 推荐(0)

导航