News for hackers. Stuff that matters.
Re:Periodical cicada Brood X will emerge in 15 states in 2021 by 4gotunameagain on Wednesday January 20, 2021 @02:29PM (#25850819)
From wikipedia:

> The emergence period of large prime numbers (13 and 17 years) was hypothesized to be a predator avoidance strategy adopted to eliminate the possibility of potential predators receiving periodic population boosts by synchronizing their own generations to divisors of the cicada emergence period. Another viewpoint holds that the prime-numbered developmental times represent an adaptation to prevent hybridization between broods with different cycles during a period of heavy selection pressure brought on by isolated and lowered populations during Pleistocene glacial stadia, and that predator satiation is a short-term maintenance strategy.

Wow.

Re:Periodical cicada Brood X will emerge in 15 states in 2021 by dmit on Wednesday January 20, 2021 @02:55PM (#25851137)
Classic devops trick. Schedule your jobs at prime intervals - this way it's much less likely to get concentrated waves of traffic at 0:00, or 12:00, or in exact 15-minute increments.
Re:Periodical cicada Brood X will emerge in 15 states in 2021 by rdtsc on Wednesday January 20, 2021 @03:48PM (#25851782)
Excellent advice. Good for programming in general when it comes to sleeps or waits and such. If you have multiples of 10s everywhere when an error happens every, say, 10 or 20 seconds, it might be hard to tell where it's coming from. But if you make them relatively prime to each other, you can can easily tell: "Oh it happens every 37 seconds? I know exactly what that is!"
Re:Periodical cicada Brood X will emerge in 15 states in 2021 by WmyEE0UsWAwC2i on Wednesday January 20, 2021 @05:40PM (#25852930)
Thia avoids collisions as long as the process takes less than one unit of time to complete.

If not, processes that take more than one unit will overlap eventually[0]

[0] Advent of code 2020, day 13. https://adventofcode.com/2020/day/13

Re:Periodical cicada Brood X will emerge in 15 states in 2021 by _5659 on Wednesday January 20, 2021 @04:26PM (#25852207)
Addendum: Don't just pick any prime numbers. The Babylonians devised our time system because it's highly composite or 'antiprime'.

So obvious primes such as 2, 3 and 5 won't do.

Re:Periodical cicada Brood X will emerge in 15 states in 2021 by DiggyJohnson on Wednesday January 20, 2021 @03:29PM (#25851568)
Wow. This one simple trick actually just made my day. Cheers.
Re:Periodical cicada Brood X will emerge in 15 states in 2021 by m463 on Thursday January 21, 2021 @02:23AM (#25856407)
It would be kind of cool if cron could incorporate this sort of trick.

Like have a deterministic way of starting stuff that is not urgent, but has to be done in a certain window.

for example, I have cron jobs that run every night, and I run them at times like 2:13 am and 2:27 am.

it would be nice to say: run this at 2:<prime> at night, different every night

It would be nicer to say: run these groups of things at night, in order, but at randomized non-overlapping times or similar

Re:Periodical cicada Brood X will emerge in 15 states in 2021 by xorcist on Thursday January 21, 2021 @03:48AM (#25856843)
Many cron systems have this functionality. At least anacron and cronie (RHEL) supports the RANDOM_DELAY variable. Check your man 5 crontab.

There's also systemd timers which can replace cron jobs with RandomizedDelay.

Before that, people used to include a random sleep in the actual job.

Personally, I tend to not use these things and instead pick a random start time when provisioning the job. That way the time delta between run is constant, which is often desired.

Re:Periodical cicada Brood X will emerge in 15 states in 2021 by m463 on Thursday January 21, 2021 @08:40AM (#25858655)
The systems I use seem to have cron, but I will check it out. Thanks for the pointer.
Re:Periodical cicada Brood X will emerge in 15 states in 2021 by kevin_thibedeau on Wednesday January 20, 2021 @09:55PM (#25854774)
Multiples of phi will do this even better.
Re:Periodical cicada Brood X will emerge in 15 states in 2021 by ZeljkoS on Wednesday January 20, 2021 @05:53PM (#25853026)
There is an entire Numberphile video dedicated to that: https://www.youtube.com/watch?v=j7jfHM-mMC4
Re:Periodical cicada Brood X will emerge in 15 states in 2021 by FPGAhacker on Thursday January 21, 2021 @02:45AM (#25856515)
Also from Wikipedia:

> The next regular appearances will be in 2021 and 2038.

My friends, behold the parents of the 2038 bug.

Re:Periodical cicada Brood X will emerge in 15 states in 2021 by OpieCunningham on Thursday January 21, 2021 @03:42AM (#25856802)
This 2038 bug won’t stay buried for long.
Re:Periodical cicada Brood X will emerge in 15 states in 2021 by pixelpoet on Wednesday January 20, 2021 @09:13PM (#25854512)
Related thing for moderate dimensional sampling, the Halton sequence: https://en.wikipedia.org/wiki/Halton_sequence
Re:Periodical cicada Brood X will emerge in 15 states in 2021 by CGamesPlay on Wednesday January 20, 2021 @10:50PM (#25855175)
The first idea doesn't make sense to me. What evolutionary tool did cicadas have access to that would enable them to do something which the predators would be unable to do?