Better HN
topnewbestaskshowjobs
Log inSign up

andoma

571 karma · joined Jan 21, 2013 (13y ago) · 134 submissions

Submissions

comment 5y ago · link · parent

This would be superior of course. Ideally being able to limit maximum runtime down to one hours.

comment 5y ago · link · parent

I run a small CI system which starts relatively beefy preemptible instances for jobs. Normally those instances are terminated by the job scheduler as soon as there's nothing more to do. But it's a great peace of mind knowing they can't run for more than 24h if my job scheduler screws something up for whatever reason. I see it as a feature rather an a limitation for my use case.

comment 5y ago · link · parent

Loled at this.

comment 5y ago · link · parent

> * Badges on Issue tracking on the issues created by backers

This can be a slippery slope. It could easily be mis-interpreted as "Hey, I payed $3 last month so I want you to prioritize my bugs". Generally I think for these kind of sums it should be clear that you donate and pay as a thank-you for what's already there, not for what (in your opinion) should come. Using it to highlight issues would work against that IMHO.

comment 5y ago · link · parent

This is the correct answer

comment 6y ago · link · parent

Alternatively "There is no such thing as bad weather, only bad kleather"

https://youtu.be/ua1FAlHt_Ys?t=232

comment 6y ago · link · parent

gcc have -Og which turns on optimization steps that can be enabled without sacrificing debugability.

comment 6y ago · link · parent

In theory yes. However, in practice static linking with glibc pulls in a lot of dead weight, musl comes to the rescue though:

test.c:

  int main(int argc, char **argv) {
    printf("hello world\n");
    return 0;
  }
Dynamic linking (glibc):

  $ gcc -O2 -Wl,--strip-all test.c
  $ ls -sh a.out
  8.0K a.out
Static linking (glibc):

  $ gcc -O2 --static -Wl,--strip-all test.c
  $ ls -l a.out
  760K a.out
Static linking (musl):

  $ musl-gcc --static -O2 -Wl,--strip-all test.c
  $ ls -sh a.out
  8.0K a.out

comment 6y ago · link · parent

> The benefits you'd get from going to a weaker memory model are by not having that extra coherency in the critical path in the first place. Adding extra muxes in front of it to make it optional would be worse than just having it on all the time.

Indeed true, good point.

> That wouldn't help because two threads could be running at the same time on different cores against their respective L1 and store buffers.

Of course, this was related to the cost of switching coherency protocol during context switch. But as you say the overhead of just making it switchable is prohibitive in itself.

comment 6y ago · link · parent

> 3) Some stricter memory model in hardware? Seems like that'd go against most of the stated reason for switching to ARM in the first place.

I would assume that a more strict memory model would be enabled only for processes that needs it (ie, Rosetta translated ones). So a cpu-flag is set/cleared when entering/exiting user mode for those processes. Does this require a separate/special cache coherency protocol? A complete L1d flush when entering/leaving these processes (across all CPUs)? Not and expert in this field and it feels complicated for sure. Is it worth it for just emulating "legacy" applications during a transitional period? Perhaps Apple can pull it off though.

comment 6y ago · link · parent

I wonder how it handles the stricter memory ordering from x86? For example, this code:

  void store_value_and_unlock(int *p, int *l, int v)
  {
    *p = v;
    __sync_lock_release(l, 0);
  }
on x86_64 compiles to:

   mov     dword ptr [rdi], edx
   mov     dword ptr [rsi], 0
   ret
vs on arm64:

   str     w2, [x0]
   stlr    wzr, [x1]
   ret
Notice how the second store on ARM is a store with release semantics to ensure correct memory ordering as it was intended in the original C code. This information is lost as it's not needed on x86 which guarantees (among other things) that stores are visible in-order from all other threads.

comment 6y ago · link · parent

https://goteam.video/ (Disclaimer/Plug: I work for the company that built this). It's WebRTC based but should work fine in Chrome, Safari, Firefox and latest Edge (ie the Chrome variant). We've just added optional end-to-end encryption for multiparty sessions based on the recent "Insertable Streams" feature available in Chrome M83+.

comment 6y ago · link · parent

My dad bought a DX7 when I was a kid. This sure bring back some good memories!

comment 6y ago · link · parent

Features vs page load time is very impressive.

comment 6y ago · link · parent

Sorry no, I've only done this for Android yet.

comment 6y ago · link · parent

io_uring requires userspace to access it using a well-defined load/store memory ordering. Care must be taken to make sure the compiler does not reorder instructions but also to use the correct load/store instructions so hardware doesn't reorder loads and stores. This is easier to (accidentally) get correct on x86 as it has stronger ordering guarantees. In other words, if you are not careful your code might be correct on x86 but fail on Arm, etc. Needless to say the library handles all of this correctly.

comment 6y ago · link · parent

So it's a Windows and MacOS bug then? Ie, no shadow should fall on io_uring really?

That said, nice dig figuring this out. These type of bugs can be really frustrating to round up.

comment 6y ago · link · parent

I've been building a native-only Android app for testing various aspects of a cross-platform (ie, Android and iOS) library we use at dayjob. Building and running with Makefile feels so liberating and is so d*mn fast compared to the Android Studio and Gradle molasses. Can recommend.

comment 6y ago · link · parent

Here's a good presentation from Nvidia on the topic (Cuda specific): https://developer.download.nvidia.com/assets/cuda/files/redu...

comment 6y ago · link · parent

> 3. Learn how to use emacs in a tight code and test loop.

Came here to say this. Having a build delay for an average incremental change (edit a single file / compilation unit) be less than 2 seconds is extremely important for my productivity. Whenever I happen to do mobile development (this goes for both Xcode and Android Studio), having to wait 5+ seconds for the app to launch makes me lose focus.

comment 6y ago · link · parent

Yup, Amiga's Autoconf [0] was ahead of its time.

[0] https://en.wikipedia.org/wiki/Autoconfig

comment 6y ago · link · parent

TCL have an interesting feature where user defined functions (or commands as it's called) can return TCL_RETURN, TCL_BREAK, or TCL_CONTINUE (in addition to TCL_OK and TCL_ERROR as you would expect) which directly affects control flow in the calling functions.

comment 6y ago · link · parent

Related: https://www.youtube.com/watch?v=wVphFkaX1gg (Restoration of a C64 left outdoors for over a decade)

comment 6y ago · link · parent

As others have mentioned, also using SSM Parameter Store (if you're in AWS) + KMS. Running most of our micro services using ECS (Fargate) which can populate environment variables directly from secrets in SSM Parameter Store.

comment 6y ago · link · parent

Got pretty much the same setup. Works very well.

comment 6y ago · link · parent

Yes, this. An example: I remember a few years (?) ago someone complained on Twitter to Elon about people leaving their cars hooked up to super chargers all day (basically just using the super chargers as parking lots). In less then a week (if I remember correctly) a firmware upgrade was out that imposes an idle charge if you leave your car in the Super charger after it's full. I just can't see any other car company being able to deploy these kind of things on that timescale. Perhaps Tesla just happened to have this feature in the pipeline already and just feature flagged it to "on"? Still something other car companies just can't do.

comment 6y ago · link · parent

I almost always use mutexes and condition variables. Almost never semaphores. I wholeheartedly agree with the post about recursive mutexes being bad. I find it always a indication of bad design and/or ”lets make this code multi-thread safe by slapping a giant big mutex around all entry points”

comment 6y ago · link · parent

Huh? I think it's one of the major upsides with an EV. Your "tank" is always full in the morning. No "Dang it, need to go and fuel up" first thing when leaving.

comment 6y ago · link · parent

In my experience (having embedded both spidermonkey and duktape) is that if embedding is not a primary use case for the engine it can get messy and complicated to update (lots of api breakage etc). This was the reason I switched from spidermonkey to duktape for my app. That said, it was probably five or six years ago. Perhaps things have changed since. I guess the takeaway is just that. If the engine isn’t maintained for embedding. Don’t use it as such.

comment 6y ago · link · parent

Can recommend https://buildroot.org/ for building complete Linux system images. Been using it on multiple embedded projects, both personal and professional.

Somewhat related, I've also used buildroot in both AWS and GCP to run workloads from read-only system images. Quite liberating in my opinion. No ssh, no ansible, etc. Build the image, launch it and off it goes. GCE even allows you to use the same boot disk, if mounted read-only, for multiple instances, perfect for these type of images.

12345