Ruby sinatra-synchrony is obsolete 了?

fsword · 2013年12月23日 · 最后由 fsword 回复于 2013年12月28日 · 3550 次阅读

最近没有关注,刚刚发现这个——

NOTICE: sinatra-synchrony is obsolete.
This gem should not be considered for a new application. It is better to use threads with Ruby, rather than EventMachine. It also tends to break when new releases of ruby come out, and EM itself is not maintained very well and has some pretty fundamental problems.

I will not be maintaining this gem anymore. If anyone is interested in maintaining it, feel free to inquire, but I recommend not using EventMachine or sinatra-synchrony anymore.

作者为什么说 It is better to use threads with Ruby ?

哇,Thread 才是未来?

#1 楼 @hooopo - -|| 大家都这么喜欢开玩笑

Fibur = Thread

一直在用 em-synchrony

不懂,求大牛分析。。

#1 楼 @hooopo 莫名,ruby 的 thread 不是 OS thread 么?还有 GIL 的代价,这几个月有技术突破? #6 楼 @ShiningRay celluloid 不熟悉,它里面用的是 thread?

#7 楼 @fsword Celluloid 就是用的 Thread。它修改了对象的 new 方法,在 new 里新建了 Thread

dalli 里曾经引入了 EM(或者 em-synchrony),但后来被移除了。dalli 的作者也是 sidekiq 的作者,很推崇 Celluloid

好奇怪 最近还特别崇尚 Node 的单线程事件的理念呢

#1 楼 @hooopo ..fibur 才是未来!!

归根是 eventmachine C++ 写的问题太多...

哈哈哈哈哈哈哈哈哈看了下 Fibur 的 github 源码笑惨了。

#7 楼 @fsword #8 楼 @fancy Celluloid 是 Actor 模型,但实际上可以用 Thread 或者 Fiber 来调度 task jruby 和 rubinius 没有 GIL

#14 楼 @ShiningRay jruby 问题不大,不过我看到这些讨论的上下文并不是限于 jruby 的,所以才奇怪。 按照你的说法,实际上 celluloid 还是一个 actor 的工作方式,只不过 actor 在 thread 里面调度的?那倒是没问题,不过如果有谁写点 fiber 代码,结果肯定极其意外啊

#15 楼 @fsword 所以 celluloid 的 wiki 里说了不推荐自己写 fiber

#16 楼 @ShiningRay 喔,有点反潮流

#12 楼 @luikore 你的 nyara 怎么样了?搞点慢处理长连接的例子吧

#18 楼 @fsword 也 obsolete 了... Fiber 节省下来的 context switch CPU time 比起 AR 吃的时间还是太少了,作用就剩下跑 benchmark 了...

#19 楼 @luikore 放弃的太早了啊,AR 的臃肿是可以控制的,大不了还可以分布式以后推到后端系统中。现在 ruby 的高并发支持太弱,我都有点想用 elixir 了

需要 登录 后方可回复, 如果你还没有账号请 注册新账号