Re: [ROOT] Threading and windows: TThreads in general?

From: cstrato@EUnet.at
Date: Fri Mar 15 2002 - 20:35:40 MET


Dear Rooters

Maybe this is a good opportunity to ask some questions about TThread:

1, In which cases would it be recommended to use class TThread?

2, Support for Dual-Processor machines:
Sorrowly, I do not have such a machine :-(, but for interest:
If you write programs in root and want your program to take advantage
of a dual-processor machine:
What is the best way to achieve this goal?
Do you need to use PROOF?
Would TThread support dual-processors?
As far as I understand, Mach (MacOSX) threads support SMP. Does
root TThread support this? What about Linux? Does not WinNT also
support threads?

3, The tutorial spyserver.C shows how a TServerSocket can handle
requests from two or more clients. No threads are necessary.
In which cases would threads be necessary?
Could this tutorial be expanded to show how to use TThreads?

Thank you.

Best regards
Christian
----------------------------------
C.h.r.i.s.t.i.a.n  S.t.r.a.t.o.w.a
V.i.e.n.n.a,  A.u.s.t.r.i.a



Valeri Fine wrote:

> Hello Joe,
>
> > Hi Rooters,
> >
> > I was reading the Thread section in the root manual and browsed through some
> > root mailing list messages> Sorry , but its not 100 % clear for me: DO ROOT
> > threads work under windows ??
>
>   It is not clear what did you mean  "ROOT thread".
>   ROOT system has some class called TThread.
>   That has not been implemented under Win32 yet.
>
> > It looks like the main problems are in
> > graphics and cint, so if my classes do NOT use root graphics (QT instead)
> > and run as a MSVC compiled exe and NOT in cint interpreted, can I than use
> > SAFELY threads under windows ??
>
>  None can run threads safely unless one knows what "thread" is.
>  None should use threads unless he/she knows the strong reasons to do so.
>  None can avoid using CINT within ROOT package.
>
> > If so, what happens, if a thread executes QT classes ? Is the system
> > correctly executing everything as a thread, or would something like this
> > crash because of qt's owned message loop ?
>
>  Nothing happens unless the codes run by different threads have to share
>  their data. It doesn't matter whether qt "owns the message loop" or not.
>  On other hand if your threads do not share any data then there is no reason
>  to create these threads at all. They can be replaced by two independent
>  processes.
>
> TrollTech Web site http://doc.trolltech.com/2.3/threads.html says:
>
> " . . . This document is intended for an audience that has knowledge
>
> and experience with multithreaded applications. Recommended reading:
>
>   a.. Threads Primer: A Guide to Multithreaded Programming
>   b.. Thread Time: The Multithreaded Programming Guide
>   c.. Pthreads Programming: A POSIX Standard for Better Multiprocessing (O'Reilly Nutshell)
>   d.. Win32 Multithreaded Programming
>
>   Hope this helps.
>                                                     Valeri
> >
> > Thanks for any clarification
> >
> > Joe
> >
> >
> >
> > _________________________________________________________
> > Do You Yahoo!?
> > Get your free @yahoo.com address at http://mail.yahoo.com
> >



This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:46 MET