Subject Re: [firebird-support] Re: Classic vs SS
Author Mark Rotteveel
> I thought that SS just started one instanse of FBServer and that windows
> and linux wasn't able to use more than 1 CPU.
> I was under the impression, that both windows and linux would swap the one
> instance between the two CPUs.

Yes in the case of SuperServer there is one instance, but there are multiple threads per instance to handle multiple connections. The problem is not that that Windows and Linux are not able to handle more than one CPU for a program (they are perfectly capable to do that).

Disclaimer: I am not entirely up to speed with the internals of Firebird, so I might be (very) wrong.
The problem is AFAIK that the code of Firebird is not fully SMP capable (probably missing synchronisation and other thread safety features etc). In general threads in multi-threaded programs can, if scheduled on different CPUs, have different views on shared objects (eg cache).
This can happen if threads of one program run on different CPUs. These threads can share objects, but those objects could be in the local CPU cache or even in the registers of the CPU. Without synchronisation it is not guaranteed that threads on different CPUs have the same view/version of those objects. That could result in all kinds of 'fun' errors, data inconsistency, crashes etc.

Therefor - at least on Windows - SuperServer is by default locked to one CPU (the first one), so that this cannot happen.

> Whereas Classic would start on FBServer per connection and that this was
> more efficient on both linus and windows.

It is only more efficient in that you can use more than one CPU. This is possible because using multiple instances (one per connection) does away with most of those sharing problems I described. In terms of memory (separate cache etc) and process overhead (more memory, additional time for creating/destroying processes etc) it is less efficient.

In other words, see what is more performant in your specific situation.

Mark
--
Jetzt kostenlos herunterladen: Internet Explorer 8 und Mozilla Firefox 3.5 -
sicherer, schneller und einfacher! http://portal.gmx.net/de/go/chbrowser