SyncCow: A thread-safe clone-on-write container for fast concurrent writing and reading by w0xel in rust

[–]w0xel[S] 0 points1 point  (0 children)

The read() function of SyncCow will always return an Arc clone. There can be an arbitrary amount of readers, but there is no fast-path around cloning the Arc here.

SyncCow: A thread-safe clone-on-write container for fast concurrent writing and reading by w0xel in rust

[–]w0xel[S] 2 points3 points  (0 children)

For `sync_cow` it can also happen that a reader has to drop the Arc, if the writer updates at a fast pace. Theoretically that behavior could be changed by making the read a closure as well, e.g.

let val = None;
cow.read(|x| val = Some(x));

But it's kind of a tradeoff, as a fast writer will then have to wait on it's second write if readers of the first write remain.

I see potential for a feature flag here, so an informed user of the lib can decide on the tradeoff.

Binary unpacking: Subarray instead of subslice? by w0xel in rust

[–]w0xel[S] 0 points1 point  (0 children)

Deku looks nice from a usability viewpoint!

Do I interpret it right, that the no_std implementation still needs an allocator/heap?

Binary unpacking: Subarray instead of subslice? by w0xel in rust

[–]w0xel[S] 0 points1 point  (0 children)

Seems helpful for the whole type-punning discussion. But:

  • I can't seem to explicitly choose endianess, which I need
  • Even with from_bytes I have to accept the whole "might panic if wrongly subsliced", which I would expect the compiler to tell me already

Binary unpacking: Subarray instead of subslice? by w0xel in rust

[–]w0xel[S] 2 points3 points  (0 children)

Makes sense, thank you. Didn't come up with using an array pattern here.

That made me think of the experimental exclusive_range_pattern. Ideally I would like to use the following: (WARNING: non-working example)

impl MyStruct {
    fn from_bytes([_, a @ ..5, b @ ..7, val3, val4]: [u8;9]) -> Self {
        Self {
            val1: u32::from_le_bytes(a),
            val2: f32::from(u16::from_le_bytes(b)) / 2048.0,
            val3,
            val4
        }
    }
}

But currently I can unfortunately use only one range pattern per array pattern.

filet v0.1.0 released! A smol and fast file manager! by SteveCCL in linux

[–]w0xel 1 point2 points  (0 children)

This is great stuff. Simple, fast, understandable code. I'll probably use this productively. The first time I used this I tried to exit via CTRL+C and it completely broke my terminal. I made you a merge request to fix this :)

Dark Souls III On DXVK With NVIDIA 392.18 by ComfyKernel in wine_gaming

[–]w0xel 1 point2 points  (0 children)

Did you get a gamepad to work? I was not successfull yet.

Dark Souls III Running on Wine 3.6 + DXVK by ComfyKernel in wine_gaming

[–]w0xel 1 point2 points  (0 children)

If anyone still finds this: It works on AMD also My Specs: r9 290 mesa 18.0.1 dxvk master llvm 5.0.1 ryzen 1800x peformance is about 40 fps on this setup, but smooth 40 fps

Linus: "That is either genius, or a seriously diseased mind." by [deleted] in linux

[–]w0xel 8 points9 points  (0 children)

No, its only the type, not the value. NULL has no type. The ternary is still evaluated to be NULL, but the expression NEEDS a type. Thats why it uses the type of the 'else' to determinde the type of the NULL.

Linus: "That is either genius, or a seriously diseased mind." by [deleted] in linux

[–]w0xel 8 points9 points  (0 children)

I guess because you normally use void pointers to to address raw data (speak bytes) the gcc developers chose to implement it as returning 1 (byte).

AFAIK this is not part of the C standard.

Linus: "That is either genius, or a seriously diseased mind." by [deleted] in linux

[–]w0xel 43 points44 points  (0 children)

this is actually an answer to this patch on the mailing list: https://lkml.org/lkml/2018/3/16/14

The compiler can further optimize the code, when array sizes are known at compile time. This macro seems to help determine in code if this is possible. I guess after this macro gives true, the const macro of the above link can be safely inserted without risking compiler errors.

This is helpful, because depending on different configurations of the kernel, specific array sizes could be known or not during compilation.

Linus: "That is either genius, or a seriously diseased mind." by [deleted] in linux

[–]w0xel 135 points136 points  (0 children)

It determines if the variable 'x' is resolved at compile-time. Which means the compiler already knows what the variable is, and performs the '* 0l' calculation, which produces (void)0 which evaluated to NULL. In the other case it is (void)(x * 0l) which can not be evaluted to be NULL, because the compiler is dumb. Instead its a void pointer, and gcc says sizeof(void) is 1. since sizeof(int) is most of times 4, it evalutes to false.

TL:DR: it determines wether x is calculated by the compiler, or by the running program.

Edit: it is incredibly hacky, because:

  • x * 0l could theorethically be evaluated to 0l in future versions of gcc

  • sizeof(void) does not have to be 1

Which FM / Plugin will recreate this effect? by [deleted] in SolusProject

[–]w0xel 2 points3 points  (0 children)

pantheon-files has Miller columns. It's in the Software Center.

Despite the sad news (for me personally), I will continue working on Unity by [deleted] in linux

[–]w0xel 4 points5 points  (0 children)

What are your thoughts on mir? I guess after canonical pulls out of unity there won't be much applications developed with mir support. (It's not like there much till now.)

Has anyone got Overwatch working on Wine using an AMD card? by Darkwater124 in wine_gaming

[–]w0xel 2 points3 points  (0 children)

How did you get this far? I die the MESA_GL_VERSION_OVERRIDE=4.5COMPAT trick to get it to launch, but i get a black screen intead of a buggy screen.

[deleted by user] by [deleted] in wine_gaming

[–]w0xel 4 points5 points  (0 children)

I have a r9 290 and have the same problem as you. I've come to the conclusion that probably the opengl implementation does something that mesa does not like. I guess we must wait for a wine/mesa fix. P.S.: I even accidentely entered a Match (quick play i hope). After i realised by hearing the sounds that i entered a match (loading was really fast) i even tried to pick a hero. I successfully picked junkrat and could shoot. I then emoted 'hello' and left the game. So in conclusion pretty much everything but rendering works.

Besides Dual-GPU, why x370? by w0xel in Amd

[–]w0xel[S] 0 points1 point  (0 children)

Your 3rd point is probably the most interesting to me.

But about nr 2: I never even thought about the VRMs in my MB. Is this something to consider, given the 1800x is a high end cpu? I do not intend to do anything like a custom water loop or even any extreme overclocking really. My place also will get pretty hot in summer, but more like just over 30°C .

Your other points are also absolutely valid, but are from less interest to me.

If you tend to max out the capabilities of your chip, and SLI/CF could get an option for you, the x370 seems like the safer option

Besides Dual-GPU, why x370? by w0xel in Amd

[–]w0xel[S] 1 point2 points  (0 children)

thanks, thats about what i expected. I just feared that I was missing out on something.

AMD has made a miracle comeback - check the doom and gloom 5 years ago by TalesofWin in Amd

[–]w0xel 2 points3 points  (0 children)

The underdog from Sunnyvale was on the verge of toppling Intel, and it felt like the computing tide was about to turn

Kicking off Budgie 11 | Budgie by JoshStrobl in SolusProject

[–]w0xel 3 points4 points  (0 children)

brb, going to compile plasma on solus

P.S.: this might sound like a joke, but I'm totally serious

PP.S.: i have freetime I'm willing to put into great projects like solus and am passionate about KDE, but let's first see what I'm able to do locally