4 ms·
> You really prefer Python threading to anything?! The Python 'process' and 'queue' modules rock (yes, multiple single threaded processes still counts as multi
by nailer 13y ago
> You really prefer Python threading to anything?!
The Python 'process' and 'queue' modules rock (yes, multiple single threaded processes still counts as multithreading). I've had apps on the front page of HN / Smashing Mag using them, happily taking advantage of a multicore server.
I swear half the people who bitch about the GIL have never used either of these modules (not you, people in general).
- berntb 13y agoI answered a comment re threading, not different multi process implementations. (All the popular scripting languages have bad threading support and try to do everything with multiple processes, afaik. It should be possible to add good support, but I guess it isn't really worth it?)
- nailer 13y ago> I answered a comment re threading, not different multi process implementations. I'd argue single process multiple threads, vs multiple process single thread, vs not blocking, are different solutions to the same problem: how do I take advantage of multiple cores? Saying other solutions don't apply, despite solving the problem, is a bit arbitrary.
- Mithaldu 13y agoAs long as multi-processes can't share variables, nevermind complex data structures made of variables, they don't apply to the problem multi-threading solves.
- nailer 13y agoshrug The queue module takes complex data structures, provides them to processes, which when finished doing whatever they do, send them back to other queues and in turn more processes. It works, complex data structures are being shared. There's no nightmarish locking issues. Not sure what else you want. Are you entirely sure you're not discounting the solution because It's Not What Java Does?
- Mithaldu 13y agoI'm sorry if that wasn't clear, sharing doesn't only mean "making the data available" but also means high performance and direct access. Quite simply though: If you can't imagine different use profiles that make certain multi-processing paradigms better suited than others, then you shouldn't be having this discussion and should be getting more experience outside of what you're doing right now.
- nailer 13y agoI'm just pointing what's solved the problem for me, and how it can be useful for others. I'm aware there's a performance overhead. > If you can't imagine different use profiles that make certain multi-processing paradigms better suited than others, then you shouldn't be having this discussion and should be getting more experience Conversely, there's also a huge gain in architectural simplicity which I hope you are aware of. Though you have neither acknowledged nor disproven that yet - based on your last comment, I think this is because you are an asshole. That's not an ad hominem attack, but rather an assessment of your personality after conversing with you here. I have tried discussing with you technically, and not acknowledging other's points, then responding with "if you can't imagine my points, I can't tell you" is not how a rational, polite adult with a technical viewpoint converses with others.
- Mithaldu 13y agoI'm not saying i can't tell you, i'm saying i don't have the patience. I could throw the book at you and the library besides, but you showed quite clearly that you lack the experience to know which problems multi-threading solves. This means that both of our time is better used if you went and got the experience. I don't want you to shut up, i want you to go and learn something. On the other hand, yes, i am an asshole. That's why i'll suggest you try and build a minecraft clone with a multi-process/single-thread solution PS: > Conversely, there's also a huge gain in architectural simplicity which I hope you are aware of. Though you have neither acknowledged nor disproven that yet I absolutely said so. I expressed quite clearly that different multi-processing solutions apply to different categories of problems, which of course means that there are problems which simple, plain multi-process solutions excel at, for example webservers.
- swift 13y agoUsing multiple single-threaded processes still counts as parallelism, sure, but please don't set a precedent for using the term "multithreading" to mean something other than "using multiple threads". Nobody who works professionally on these sorts of problems would understand "multithreading" in the way that you're using it. (The term is overloaded enough as it is, given that it glosses over the distinction between user-space and OS threads...)
- nailer 13y agoI understand your point, but there are people who'd argue non-OS 'threads' aren't actually threads either - if ps -eLF doesn't show more than 1 LWPs for your PID you're not considered multithreaded.