On Thu, 28 Dec 2000 Richard MacLemale <[EMAIL PROTECTED]> wrote:
> Thanks to MetaCard I've learned some basic TCP/IP, developed my own e-mail
> and ftp clients, and incorporated them into some software that I've sold.
> Neato! The next step, obviously, is to create applications like mchttp,
> which run on the server.
>
> I remember reading something here about MetaCard 2.3.2 being able to
> simulate multithreading using "wait with message"...
>
> So...
>
> Is this the solution for people who don't want to use mchttp because it
> handles only one job at a time and thus can't match the speed of web hosting
> programs such as WebStar?
No: this feature is only for programming convenience and would offer
nothing in terms of performance (in fact, it will most likely slow
things down, just as multithreading in other languages does).
> Will mchttp be updated to include 2.3.2's new "wait with message" feature?
No, there's no need for this. "wait with messages" is designed
primarily to support simulation of blocking I/O calls while still
allowing some events to be delivered. One such example is
"put http://someurl into somevariable", where the download must be
completed before the "put" command can finish its work and where
complete download may require handling of many messages.
> Using "wait with message", how fast would MC be able to serve up web pages
> and graphics? Compared to WebStar?
We haven't done any serious benchmarking on this yet, but my educated
guess is that a well-tuned server written in MetaTalk will be
somewhere between 50% slower and twice as slow as a server written in
C. This should be good enough for the 95% of cases where the server
is rarely if ever used at capacity.
> If multi-threading is a possibility in future versions of MC, should I be
> wasting my time with "wait with message?"
No but not because we're even considering adding thread support to the
language. It's because an event-driven application (e.g., using "read
to socket with message" and "write to socket with message") is more
efficient and usually easier to write and debug than one that uses
"wait with message" or any other multi-threading system. In fact,
multithreading is such a pain in the ass that we've gone to
considerable effort to *remove* all of the existing multithreading
code from the engines for the next release and will rely totally on
event-driven architectures instead.
> And finally...
>
> What would be a simple example of using "wait with message" to allow MC to
> handle multiple socket requests?
No need to do this: using the "with message" clause of the read,
write, and accept commands will allow you to write a server with
maximum efficiency.
Regards,
Scott
>
> :)
> Richard MacLemale
> Instructional Technology Specialist
> James W. Mitchell High School
********************************************************
Scott Raney [EMAIL PROTECTED] http://www.metacard.com
MetaCard: You know, there's an easier way to do that...
Archives: http://www.mail-archive.com/[email protected]/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.