Re: Basic question about threads and SMP

1999-12-05 Thread Nick Hibma


Being multi-threaded has almost nothing to do with being
multi-processor. Multi-threading means that your application has
multiple threads of execution that are able to run simultaneously.

The multi-processing capability of your box means that 2 threads of
execution, be it a process or a thread within a process, are executed
_literally_ at the same time, and not in simulated concurrency like it
happens on a UP box.

Whether or not any application should be compiled with libc_r depends
solely on the application itself. And, as you suggest, that is decided
at build time. If applications support multi-threading they normally
come with a Makefile using libc_r.

Now, whether you want to multi-thread Apache is totally different issue
...

Nick


On Wed, 1 Dec 1999, Doug Barton wrote:

   You know, a stray thought just occured to me, which hopefully
 won't sound to silly to people who know about this stuff. :) If I have an
 SMP box (using -Current specifically) do I want to be compiling things
 with -lc_r? I'm thinking specifically of mission critical things like
 apache, but in general will other ports and such take advantage of
 libc_r if they are compiled with it, or would a program that _can_ take
 advantage of it already have that built in, say into autoconf or some
 such? What about other parts of the base system? I'm assuming that the
 kernel is covered by virtue of the fact that I've enabled the SMP options,
 yes?
 
   I'm trying to learn more about SMP, threads, and such like in
 general. The recent conversations about those topics on the lists have
 been very educational. I'm still wading through them, but I appreciate
 being able to sit on the sidelines and glean bits here and there.
 
 Thanks,
 
 Doug
 -- 
 "Welcome to the desert of the real." 
 
 - Laurence Fishburne as Morpheus, "The Matrix"
 
 
 
 To Unsubscribe: send mail to [EMAIL PROTECTED]
 with "unsubscribe freebsd-hackers" in the body of the message
 

--
[EMAIL PROTECTED]
[EMAIL PROTECTED]  USB project
http://www.etla.net/~n_hibma/




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Re: Basic question about threads and SMP

1999-12-05 Thread Russell L. Carter

%Nick Hibma wrote:
% 
% Being multi-threaded has almost nothing to do with being
% multi-processor. Multi-threading means that your application has
% multiple threads of execution that are able to run simultaneously.
% 
% The multi-processing capability of your box means that 2 threads of
% execution, be it a process or a thread within a process, are executed
% _literally_ at the same time, and not in simulated concurrency like it
% happens on a UP box.
%
%Note that this happens ONLY if both threads of execution are processor
%mobile.  If your system supports user-space threads as part of a 
%process and the process can't be split across CPUs, you might as well
%have a UP system.  (Except everything else can run on the other
%processor, so SMP is still a small win.)
%
%This is the situation with threads and SMP in -current.
%

The LinuxThreads port is currently busted for SMP but when it
is fixed it will indeed use multiple processors:


last pid:   395;  load averages:  0.50,  0.11,  0.04 up 
0+00:13:00  20:00:40
37 processes:  6 running, 31 sleeping
CPU states: 65.8% user,  0.0% nice,  0.0% system,  0.0% interrupt, 34.2% idle
Mem: 8780K Active, 9116K Inact, 19M Wired, 68K Cache, 7000K Buf, 466M Free
Swap: 1024M Total, 1024M Free

  PID USERNAME PRI NICE  SIZERES STATE  C   TIME   WCPUCPU COMMAND
  393 rcarter   31   0   876K   152K CPU1   1   0:01 17.16%  2.39% ex3
  394 rcarter   29   0   876K   152K RUN0   0:00 15.76%  2.20% ex3
  391 rcarter   30   0   876K   152K RUN1   0:01 14.71%  2.05% ex3
  395 rcarter   30   0   876K   152K RUN0   0:01 14.01%  1.95% ex3
  392 rcarter   30   0   876K   152K RUN0   0:00 13.66%  1.90% ex3


Russell

%-- 
%"Where am I, and what am I doing in this handbasket?"
%
%Wes Peters Softweyr LLC
[EMAIL PROTECTED]   http://softweyr.com/
%
%
%To Unsubscribe: send mail to [EMAIL PROTECTED]
%with "unsubscribe freebsd-hackers" in the body of the message
%




To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message



Basic question about threads and SMP

1999-12-01 Thread Doug Barton

You know, a stray thought just occured to me, which hopefully
won't sound to silly to people who know about this stuff. :) If I have an
SMP box (using -Current specifically) do I want to be compiling things
with -lc_r? I'm thinking specifically of mission critical things like
apache, but in general will other ports and such take advantage of
libc_r if they are compiled with it, or would a program that _can_ take
advantage of it already have that built in, say into autoconf or some
such? What about other parts of the base system? I'm assuming that the
kernel is covered by virtue of the fact that I've enabled the SMP options,
yes?

I'm trying to learn more about SMP, threads, and such like in
general. The recent conversations about those topics on the lists have
been very educational. I'm still wading through them, but I appreciate
being able to sit on the sidelines and glean bits here and there.

Thanks,

Doug
-- 
"Welcome to the desert of the real." 

- Laurence Fishburne as Morpheus, "The Matrix"



To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-hackers" in the body of the message