Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^4: Standard way to convert timezone in multithreaded script

by tirwhan (Abbot)
on Nov 24, 2009 at 14:33 UTC ( [id://809088]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Standard way to convert timezone in multithreaded script
in thread Standard way to convert timezone in multithreaded script

The security concerns you name are completely irrelevant. Any user who can execute code can hog all cores of a system, any time they want to, by starting processes that do so (unless you restrict them with something like ulimit, which works just as well on threaded processes). The kernels job is to keep the system running responsive enough so that other user processes and the system in general run well. Try running the line I sent, it'll work on a single-core system just as well. If you're running a reasonably modern version of Linux you may experience some slowdown on certain other applications, but your system should not grind to a halt, nor show real signs of unresponsiveness. That's the kernel doing its job, no reason to panic, business as usual.

So all the talk about hijacking, injecting etc. completely misses the point of a multi-user system, yes you can do all these things with threads (if you're root), just as you could with processes. But no, it isn't a problem (if it were, by your reasoning, system security would be impossible on a single-core machine). The kernel only allows you as much access as the system policy dictates, and the system administrator sets system policy. You may have a point that multi-threaded apps can make things harder for the system administrator by obscuring what they're doing, because most Linux tools are built primarily with the multi-process model in mind. But, honestly, in over a decade of sysadmining multi-user systems I have never found this to be a problem.

BTW, the nodes you link to aren't really pertinent to a discussion about threads vs. processes today, they're from 2003 (only the last one, which contains very little helpful discussion on the topic, is from 2006), a time when most people were still running Perl 5.6 and (if on Linux) a 2.4 kernel. Lots of things have changed since then, and any serious discussion on the topic would have to take these changes into account (I have no desire to hold such a debate, I find it pretty pointless).


All dogma is stupid.

Replies are listed 'Best First'.
Re^5: Standard way to convert timezone in multithreaded script
by zentara (Archbishop) on Nov 25, 2009 at 10:28 UTC
    BTW, the nodes you link to aren't really pertinent to a discussion about threads vs. processes today, they're from 2003

    .... that's not true..... the problems have not been totally solved..... just look at all the relatively recent nodes where threads are crashing due to module safety problems..... and most thread use involve modules


    I'm not really a human, but I play one on earth.
    Old Perl Programmer Haiku
      the problems have not been totally solved..

      That is correct, and I never said that using threads was without problems. But using nodes from 2003 to illustrate the problems with Perl threads today is somewhat like blaming Obama for sending troops to Iraq, or criticising Einstein for the limits of classical mechanics. Things have moved on since then, and any serious discussion would have to take these changes into account.

      If you're interested in seriously criticising the usage of threads in Perl programs you should first read up on their current implementation as well as the way threads and processes are handled in multitasking, multi-user operating systems(*). Judging by your posts in this thread (especially your latest reply to BrowserUK) you really have a lot of reading to do, you do not seem to understand how multi-user operating systems work on a fundamental level, and my attempts to explain a few things were obviously fruitless.

      (*) I heartily recommend Linux Kernel Development(link is for the upcoming 3rd edition), it goes into a lot of depth but also gives you a clear technical view on how the Linux kernel works and why it works that way.


      All dogma is stupid.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://809088]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (3)
As of 2024-04-19 01:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found