From: Lothar Scholz Date: 2004-03-18T04:08:22+09:00 Subject: Re: guis and native threads (was: [ ANN] wxRuby 0.2.1 has been released!) Hello Sam, Wednesday, March 17, 2004, 6:00:11 PM, you wrote: SR> With a blocking API, couldn't you write an extension module that did SR> its work in a thread, notifying the main thread when the work was done? Sure you can do that, but often the synchronize overhead will be very high and more important then that (we are still a script language, so highest performance is not so important) is that it requires much more work and a skilled developer. Most API's like the SQLite can't be wrapped in an easy way. Every fetch of a row may block and take a long time - for example 5 disk seeks can cost around 150 ms, so you would have to write a sync handling for this on each call. But maybe the next rows are already cached, then the synchronisation can add an overhead of a few 100%. Most accesses are cached, so you have 3 alternatives: a) non blocking slow API b) blocking API c) non natural and non blocking API (for example a function that delivers rows in chunks of 50 or so) I use GNU Eiffel on work and we have the same problem with it because it neither supports user level threads nor native threads. It's no problem to solve the problems, but it is not so much fun. -- Best regards, Lothar mailto:mailinglists@scriptolutions.com