develooper Front page | perl.perl5.porters | Postings from June 2006

Re: OS abstraction (was Re: Its time we set the score straight onPerl 5 and Perl 6 and debunk our own self-generated FUD.)

From:
Tom Horsley
Date:
June 26, 2006 04:08
Subject:
Re: OS abstraction (was Re: Its time we set the score straight onPerl 5 and Perl 6 and debunk our own self-generated FUD.)
Message ID:
1151320061.25180.7.camel@tweety
On Sun, 2006-06-25 at 20:59 +0200, demerphq wrote:
> So I think that if you are going to provide an abstaction layer it
> needs to be designed with the opposite of the lowest common
> denominator in mind. Where an OS cant provide that functionality the
> abstraction layer should do what makes sense. 

Yep. A very frequent one that comes to mind is timeout operations.
A traditional unix way to timeout a connect() call is to use a
SIGALRM to interrupt the call. On win32 "signals" are pretty much
a totally library concept and interrupting a system call
with one ain't gonna happen. On the other hand, there are
variations of all the socket functions on win32 that do have
timeout available, so an OS neutral version of connect would
need to include timeout in the interface and implement it
with SIGALRM on unix and really use the native timeout on win32.

Just one example of the millions out there.

The challenge being to think up all the examples when designing
your abstraction layer :-).




nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About