Jochen Schmitt Jochen@herr-schmitt.de schrieb:
Bei FUSE hat man aber, wie auch bei anderen Konzepten, die z. B. für Minix entwickelt wurden, das Problem, dass durch den Taskswitch wertvolle CPU-Zeit verloren geht.
Dieses Problem ist aber an anderer Stelle bereits gelöst, nämlich in Form von leichtgewichtigen Threads. Am bekanntesten dürften die von Erlang sein, aber es gibt noch weitere Implementierungen.
Allerdings scheinen keine davon "Unix-tauglich" zu sein.
Das erinnert mich daran, wie man mit Ajax & Polling verzweifelt versucht, dynamische Webseiten trotz HTTP-Zwang zu bauen. Man "löst" dort Probleme auf eine sehr umständliche Weise, die eigentlich kein Problem wären, wenn man sie auf einer tieferen Ebene angeht (HTTP erweitert bzw. gegen etwas anderes austauscht).
In diesem Bereicht hat man zwei Probleme:
1.) HTTP ist ein verbindungsloses Protokoll bei dem die Informationen zwischen den Dialogschritten auf em Server verloren gehen.
Nein, das meinte ich gar nicht. Klar, auch hier sind auch Workarounds nötig (Session-ID, Cookies). Aber das ist Kleinkram, der Overhead ist minimal. (er beschränkt sich im Wesentlichen darauf, abgebrochene Session zu erkennen und regelmäßig zu entfernen)
Das größere Problem ist, dass bei HTTP die Initiative ausschließlich vom Client ausgeht. Der Server kann nicht von sich aus einem bestimmten Client (oder allen Clients) irgendwelche Infos zusenden.
Also muss der Client pollen, was auf die Datenrate und vorallem die Latenz drückt. Und mit jeder Anfrage muss der Server entweder alle Daten komplett senden, oder er muss sich merken, wann welche Daten geändert wurden, um nur die interessanten Daten neu zu übermitteln.
BOSH ist eine "Vergewaltigung" des HTTP, die eine solche bidirektionale Übertragung möglich macht. Man benutzt das, um XMPP durch HTTP zu tunneln, wodurch ein XMPP-Server insbesondere hinter einem HTTP-Reverse-Proxy stehen kann, sodass er trotz Same-Origin-Policy erreichbar ist. Das ist ziemlich krank, läuft aber erstaunlich gut. Man erhält fantastische Reaktionszeiten, komplett ohne Polling. (http://xmpp.org/extensions/xep-0124.html)
Zwei große Probleme gibt es dennoch bei diesem Ansatz:
1) BOSH ist empfindlich gegenüber Netzwerkstörungen. Eine abgebrochene BOSH-Verbindung wird nicht in allen Fällen sauber erkannt, vorallem wenn noch ein HTTP-Proxy in der Mitte hängt.
2) Es gibt AFAIK nur eine einzige Java-Script-Library, die BOSH clientseitig ordentlich implementiert. Der Rest ist Schrott. (http://code.stanziq.com/strophe/)
Gruß Volker