curtisb has asked for the wisdom of the Perl Monks concerning the following question:
|
---|
Replies are listed 'Best First'. | |
---|---|
(crazyinsomniac) Re: MacPerl???
by crazyinsomniac (Prior) on Oct 10, 2000 at 10:22 UTC | |
One thing that struck me as odd, is that the documentation reccomends you rename your cgi-script *.acgi so it'll run faster, something to do with what the mac-server does? UPDATE: Here it is, from ptf.com's site: CGI vs. ACGI Most advanced web servers have the ability to respond to more than one request simultaneously. Unfortunately, most Mac OS web servers will wait for a CGI to finish running before responding to any other requests, whether for an HTML page, an image, or another CGI. CGIs can take a while to run, so a CGI can appear to slow down the entire server significantly. This is where Asynchronous CGI(ACGI) comes in. Web servers that can use ACGIs (most do!) will respond to other requests while the ACGI is proces- sing, instead of waiting for it to finish. Making a CGI into an ACGI is very simple: instead of using the suffix .cgi, use .acgi. Actually, you should always use the .acgisuffix for your CGIs, as there is really no reason not to (unless you wantto slow down the server :-). Note:ACGI has nothing to do with how many simultaneous requests MacPerl can handle. A given instance of MacPerl can only execute one you may well get in the way of your CGIs (and vice versa!). Running multiple copies of MacPerl is, however, a possible workaround "cRaZy is co01, but sometimes cRaZy is cRaZy". - crazyinsomniac | [reply] |
by tilly (Archbishop) on Oct 10, 2000 at 15:04 UTC | |
One of the basic jobs of an operating system is to coordinate between different processes/threads. The two basic choices are cooperative multitasking and pre-emptive multitasking. In cooperative the OS hands control to a process/thread and then waits for control to be handed back. In pre-emptive, control is handed over but the OS will grab control back when it wants. It will want control back after various interrupts, when the process asks for the OS to do something, or at the end of your time slice. All of the issues that I discussed in Threads vs Forking (Java vs Perl) simply do not exist for cooperative multitasking. There is never any problem with unexpected interruptions because nobody is going to interrupt you. But on the flip side any process can lock up the whole system permanently. Furthermore pre-emptive both can accomplish background tasks faster and is more responsive. (Ironically, throughput on batch jobs can be higher in cooperative - there is no need to worry about locking and unlocking.) MacOS is cooperative. DOS was. Ditto Windows 3.1. Microsoft claims that the Win9x line is pre-emptive, but in truth it is a hybrid, cooperatively multitasking 16-bit programs and pre-emptively multitasking 32-bit ones. (This was probably wise, if you pre-emptively multitask a process that was written for cooperative multitasking, a lot of race conditions come out of the woodwork.) By comparison Windows NT, BeOS, any form of *nix, VMS and so on are all pre-emptively multitasked. Indeed so is OS X. Virtually anything billed as heavy-duty, certainly anything that can use 2 CPUs, have multiple users at once, etc are pre-emptive. What this means is that on the Mac a single poorly-written process can lock up the system. Similarly if you go to the menu bar, while you are viewing the menu nothing else is going on. Your webserver is unavailable, your print jobs are not spooling, and SETI is going on without you... This is true for virtually no other OS you are likely to encounter today. | [reply] |
by tye (Sage) on Oct 10, 2000 at 18:29 UTC | |
MacOS is cooperative.[....]
Note that a single program that isn't even very poorly written can quite effectively lock up Windows NT. All you need is something that takes up a lot of CPU. Designing a complex program such that it will never use "too much CPU" is extremely difficult. This is a problem that is best solved by the pre-emptively multitasking operating system. Unfortunately, WindowsNT "solves" this problem so badly that it really isn't solved at all. Once a CPU hog starts running, WindowsNT manages to let other things run but at such a slow pace that it can takes hours to simply request that the system be shut down. Finding and stopping the hog is unthinkable. Anything not via the desktop is useless because response is so slow that time-outs are all that can be had. So one badly written process probably can't completely lock up NT as far as scheduling is concerned, but the scheduling is not good enough for this to have much pracitcal meaning. And now, back to discussions remotely related to Perl... :) - tye (but my friends call me "Tye") | [reply] |
by tilly (Archbishop) on Oct 10, 2000 at 18:56 UTC | |
by tye (Sage) on Oct 10, 2000 at 19:45 UTC | |
| |
Re: MacPerl???
by Trimbach (Curate) on Oct 10, 2000 at 16:38 UTC | |
Although MacPerl hasn't been updated in awhile (as has been mentioned before, it only tracks against the 5.004 distribution) unless you are doing some hardcore programming you are not likely to notice the difference. The biggest difference between MacPerl and the regular distribution is, IMHO, the fact that you have to use a colon (:) instead of a slash (/) as the file directory separator. Other than that, the biggest problem I've run across (compared to the Unix version) is the lack of a simple database implementation like sdbm, gdbm, ndbm, etc. The short answer to your question is that yes, in all likelihood your Perl programs should run just like you expect them to under Perl. I would strongly suggest getting a good text editor for Perl programming, though... something like the shareware Alpha or the comercial BBEdit. Both are tied into the MacPerl application and let you edit programs in a much happier friendlier environment than SimpleText. Gary Blackburn | [reply] |
Re: MacPerl???
by AgentM (Curate) on Oct 10, 2000 at 22:56 UTC | |
AgentM Systems or Nasca Enterprises is not responsible for the comments made by AgentM- anywhere. | [reply] |
Re: MacPerl???
by princepawn (Parson) on Oct 10, 2000 at 16:19 UTC | |
I just went through looking at macperl things and decided to install LinuxPPC. Mac OS X is in beta,but not really ready for Perl use yet. | [reply] |
by tilly (Archbishop) on Oct 10, 2000 at 17:25 UTC | |
Please, please, please do not lead people to believe that they can use threaded Perl. They should not. The first version of Perl that is likely to have a threading model you can depend on surviving and being maintained will be 6.0. Telling people otherwise is just inviting them to get burned! | [reply] |
by pudge (Sexton) on Apr 15, 2002 at 15:59 UTC | |
| [reply] |