Stories
Slash Boxes
Comments

SoylentNews is people

Journal by cafebabe

A problematic bug in simple-init can be resolved by eliminating one variable. Specifically, change:-

$wait=60*60*24;
while($active&& $running) {
  (undef,$wait)=select(undef,undef,undef,$wait);
}

to:-

while($active&& $running) {
  select(undef,undef,undef,60*60*24);
}

or suchlike. This change eliminates the case where the variable is zero and a busy wait on select() ensues.

Minor bugs remain. Regardless, simple-init is now suitable for deployment on systems which do not require suspend.

 

Reply to: Re:Wha?

    (Score: 2) by cafebabe on Friday August 19 2016, @11:02AM

    by cafebabe (894) on Friday August 19 2016, @11:02AM (#390025)

    To get stuff to run on Perl4, Perl5 and Perl6, avoid array slices, :: and /e regular expressions with anything apart from data which is seven bit clean.

    The underlying implementation of select() is more problematic. Different kernels may or may not set struct timeval to different levels of granularity. For my purposes, this was nice-to-have but providing a constant with each invocation is sufficient. In the general case, it may be necessary to check elapsed time with a separate system call. This may lead to further erroneous assumptions about time [infiniteundo.com].

Post Comment

Edit Comment You are not logged in. You can log in now using the convenient form below, or Create an Account, or post as Anonymous Coward.

Public Terminal

Anonymous Coward [ Create an Account ]

Use the Preview Button! Check those URLs!


Score: 0 (Logged-in users start at Score: 1). Create an Account!

Allowed HTML
<b|i|p|br|a|ol|ul|li|dl|dt|dd|em|strong|tt|blockquote|div|ecode|quote|sup|sub|abbr|sarc|sarcasm|user|spoiler|del>

URLs
<URL:http://example.com/> will auto-link a URL

Important Stuff

  • Please try to keep posts on topic.
  • Try to reply to other people's comments instead of starting new threads.
  • Read other people's messages before posting your own to avoid simply duplicating what has already been said.
  • Use a clear subject that describes what your message is about.
  • Offtopic, Inflammatory, Inappropriate, Illegal, or Offensive comments might be moderated. (You can read everything, even moderated posts, by adjusting your threshold on the User Preferences Page)
  • If you want replies to your comments sent to you, consider logging in or creating an account.

If you are having a problem with accounts or comment posting, please yell for help.