top 50 comments

sorted by: hot top controversial new old
[–] 148 points 1 year ago (4 children)

all programs are single threaded unless otherwise specified.

  • source
  • hideshow 8 child comments
  • [–] 49 points 1 year ago (3 children)

    It’s safe to assume that any non-trivial program written in Go is multithreaded

  • source
  • parent
  • hideshow 6 child comments
  • [–] 23 points 1 year ago (3 children)

    Does Python have the ability to specify loops that should be executed in parallel, as e.g. Matlab uses parfor instead of for?

  • source
  • parent
  • hideshow 6 child comments
  • [–] 52 points 1 year ago (2 children)

    python has way too many ways to do that. asyncio, future, thread, multiprocessing...

  • source
  • parent
  • hideshow 4 child comments
  • [–] 41 points 1 year ago (1 child)

    Of the ways you listed the only one that will actually take advantage of a multi core CPU is multiprocessing

  • source
  • parent
  • hideshow 2 child comments
  • [–] 11 points 1 year ago (1 child)

    yup, that's true. most meaningful tasks are io-bound so "parallel" basically qualifies as "whatever allows multiple threads of execution to keep going". if you're doing numbercrunching in pythen without a proper library like pandas, that can parallelize your calculations, you're doing it wrong.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 9 points 1 year ago (1 child)

    I've always hated object oriented multi threading. Goroutines (green threads) are just the best way 90% of the time. If I need to control where threads go I'll write it in rust.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 8 points 1 year ago (2 children)

    Are you still using matlab? Why? Seriously

  • source
  • parent
  • hideshow 4 child comments
  • [–] 18 points 1 year ago (1 child)

    No, I'm not at university anymore.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 1 year ago (1 child)
  • [–] 7 points 1 year ago (1 child)

    I was telling a colleague about how my department started using Rust for some parts of our projects lately. (normally Python was good enough for almost everything but we wanted to try it out)

    They asked me why we're not using MATLAB. They were not joking. So, I can at least tell you their reasoning. It was their first programming language in university, it's safer and faster than Python, and it's quite challenging to use.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 26 points 1 year ago (1 child)
  • [–] [S] 4 points 1 year ago (2 children)

    Oooooh this is really cool, thanks for sharing. How could I install it on Linux (Ubuntu)? I assume I would have to compile CPython. Also, would the source of the programs I run need any modifications?

  • source
  • parent
  • hideshow 4 child comments
  • [–] 5 points 1 year ago

    In this case, it's a feature of the language that enables developers to implement greater amounts of parallelism. So, the developers of the Python-based application will need to refactor to take advantage of it.

  • source
  • parent
  • [–] 5 points 1 year ago (1 child)

    From memory I can only answer one of those: The way I understand it (and I could be wrong), your programs theoretically should only need modifications if they have a concurrency related bug. The global interlock is designed to take a sledgehammer at "fixing" a concurrency data race. If you have a bug that the GIL fixed, you'll need to solve that data race using a different control structure once free threading is enabled.

    I know it's kind of a vague answer, but every program that supports true concurrency will do it slightly differently. Your average script with just a few libraries may not benefit, unless a library itself uses threads. Some libraries that use native compiled components may already be able to utilize the full power of you computer even on standard Python builds because threads spawned directly in the native code are less beholden to the GIL (depending on how often they'd need to communicate with native python code)

  • source
  • parent
  • hideshow 1 child comment
  • load more comments (1 reply)
  • [–] 24 points 1 year ago (5 children)

    Oh wow, a programming language that is not supposed to be used for every single software in the world. Unlike Javascript for example which should absolutely be used for making everything (horrible). Nodejs was a mistake.

  • source
  • hideshow 5 child comments
  • load more comments (5 replies)
    [–] 17 points 1 year ago (2 children)

    don't worry it'll use all the RAM anyway

  • source
  • hideshow 4 child comments
  • [–] 16 points 1 year ago (1 child)

    let's be honest here, he actually means 0.01 core performance

  • source
  • hideshow 1 child comment
  • load more comments (1 reply)
    [–] 13 points 1 year ago (4 children)

    Do you mean Synapse the Matrix server? In my experience, Conduit is much more efficient.

  • source
  • hideshow 6 child comments
  • load more comments (2 replies)
    [–] 12 points 1 year ago

    I tough this was about excel and was like yeah haha!

    But is about Python, so I'm officially offended.

  • source
  • [–] 11 points 1 year ago*

    I prefer this default. Im sick of having to rein in Numba cores or OpenBlas threads or other out of control software that immediately tries to bottleneck my stack.

    CGroups (Docker/LXC) is the obvious solution, but it shouldn't have to be

  • source
  • [–] 10 points 1 year ago
    [–] 9 points 1 year ago

    Python

    ..so.. so you made it single threaded?

  • source
  • [–] 7 points 1 year ago

    I'll be honest, this only matters when running single services that are very expensive. it's fine if your program can't be pararlelized if the OS does its job and spreads the love around the cpus

  • source
  • [–] 5 points 1 year ago

    It only took us how many years?

  • source
  • load more comments
    view more: next ›