[Ruby] thread or process

Podborits, Dmitry dpodbori at lehman.com
Tue May 6 21:13:30 MSD 2003


Potokov obscheniya nuznost' ychityvay
Zadachu rasforkivay, ne paralel'
Na tredy pod Linux ne ochen' rasschityvay --
Ikh porozhden'ye ne v mode teper'

A yesli sozdayesh' ty tredy v prilozhen'I,
Ne upuskai iz vidu ikh unichtoznen'ye

-----Original Message-----
From: Eugene Scripnik [mailto:Eugene.Scripnik at itgrp.net] 
Sent: Tuesday, May 06, 2003 9:39 AM
To: ruby at altlinux.ru
Subject: Re: [Ruby] thread or process


vic ismakaev wrote:
> Приветствую!
> Возник концептуальный вопрос у меня:
> под линуксом треды действительно являются полноценными тредами в 
> рамках ОС,или
> они изолированы в рамках интрепретатора руби?
И под линуксом и под другими ОС на данный момент треды _не_ являются 
native OS threads. Управление тредами осуществляется самим интерпретатором.
> И насколько эффективнее использовать треды,а не порождать новые 
> процессы.
Я не делал сравнения по скорости, и, думаю, это зависит от самой задачи. 
Треды можно порождать во время работы приложения очень часто, а можно 
создать несколько в начале и работать с ними. Так вот, если треды будут 
создаваться и уничтожаться часто, то это решение субьективно лучше чем 
форкать новые процессы.
Тут еще нужно учитывать нужность общения потоков между собой. Если нужно 
просто распараллелить задачу, то я думаю разфоркать ее вначале будет лучше.

-- 
Eugene Scripnik
IT Group
Software Architect
Tel./Fax +380 (372) 58-43-10
email: Eugene.Scripnik at itgrp.net
http://www.itgrp.net/

_______________________________________________
Ruby mailing list
Ruby at altlinux.ru
http://www.altlinux.ru/mailman/listinfo/ruby


------------------------------------------------------------------------------
This message is intended only for the personal and confidential use of the designated recipient(s) named above.  If you are not the intended recipient of this message you are hereby notified that any review, dissemination, distribution or copying of this message is strictly prohibited.  This communication is for information purposes only and should not be regarded as an offer to sell or as a solicitation of an offer to buy any financial product, an official confirmation of any transaction, or as an official statement of Lehman Brothers.  Email transmission cannot be guaranteed to be secure or error-free.  Therefore, we do not represent that this information is complete or accurate and it should not be relied upon as such.  All information is subject to change without notice.



More information about the Ruby mailing list