Home > Archive > ithreads > March 2007 > Re: threads change
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Re: threads change
|
|
| Elizabeth Mattijsen 2006-07-18, 4:09 am |
| At 11:07 PM +0200 7/17/06, Rafael Garcia-Suarez wrote:
>On 14/07/06, Artur Bergman <abergman@sixapart.com> wrote:
>
>I come to think that a better idea wrt exit() is one that was proposed
>during the referred thread:
>let exit() exit the application (like before), and add threads->exit()
>to exit the thread. Opinions?
In light of the discussions again, I think that would make the most
sense, with one addendum: to have an easy way inside a thread to make
exit() to a threads->exit() instead. If you happen to have to use a
module (over which you have no control) inside a thread that might do
an exit(). And as the owner of the thread, you don't want it to exit
the application.
Trying to do this by override CORE::exit is not a option, as you can
only do this at compile time (as far as I know).
So I would favour in extra, cloned global variable that would be
checked by CORE::Exit, which would indicate whether to really exit(),
or do a threads->exit(). And have an easy way to change the (cloned)
setting of this variable with a threads class method, e.g.
thread->exit_exits_thread_only;
Liz
| |
| Artur Bergman 2006-07-18, 7:08 pm |
|
On Jul 18, 2006, at 2:15 AM, Elizabeth Mattijsen wrote:
> At 2:07 AM -0700 7/18/06, Artur Bergman wrote:
>
> True, but generally you just "use" code in your program, which
> means the code is used by the main thread already, before you start
> the thread.
>
> Which is the reason I once wrote Thread::Use.
>
>
> Liz
Eh,
if you use a module that changes CORE::exit before you use any other
module you are set to go.
artur
| |
| Artur Bergman 2006-07-18, 7:08 pm |
|
On Jul 18, 2006, at 3:39 AM, Elizabeth Mattijsen wrote:
> At 2:29 AM -0700 7/18/06, Artur Bergman wrote:
>
> Well, that's what the "threads" module should do then.
>
I disagree, the threads module shouldn't change process level
semantics per default.
Seriously, a thread is not a process, a process is not a thread. Add
thread exit if you want, but exit should exit.
Artur
| |
|
|
|
|
|
|
|