lkml.org 
[lkml]   [2022]   [Jun]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH 3/3] kthread: Stop abusing TASK_UNINTERRUPTIBLE (INCOMPLETE)
On Mon, Jun 27, 2022 at 3:07 PM Peter Zijlstra <peterz@infradead.org> wrote:
>
> On Mon, Jun 27, 2022 at 06:04:12PM +0000, Wedson Almeida Filho wrote:
>
> > let new_thread = task::new_paused(|| pr_info!("Hello world\n"))?;
>
> I'm still having a really hard time with this Rust stuff, the above
> looks like a syntax error and random characters to me :/

Heh. The '!' for macros is probably my least favorite part of Rust
syntax, it just makes macros look so unintegrated.

Not at all the kind of "you can use a macro instead of a function"
thing, because macros always have that '!' thing.

And yeah, the pipe characters used by closures sure make that
particular line look extra magical.

The question mark is a "do if ok, return if error". Think of it like a
"try" thing for exception catching.

But yeah, all the special characters does make me think of perl.

I haven't really gotten the hang of reading rust without a google
window open to figure things out, but I think that's just a "you have
to get used to it".

Or, alternatively, you have to just ignore the rust parts.

As I mentioned at OSS NA last week - it's not like most people can
read our MM code either - even when you know C, some of that code is
pretty incomprehensible unless you know how it all works.

If people can be productive kernel developers without understanding
the MM layer, I'm sure people can be kernel developers without
understanding rust..

Linus

\
 
 \ /
  Last update: 2022-06-28 00:35    [W:0.200 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site