public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* RE: cancelling
@ 2000-07-12  7:34 Bossom, John
  2000-07-12  8:44 ` cancelling Lorin Hochstein
  2000-07-12 10:25 ` cancelling Thomas Sailer
  0 siblings, 2 replies; 7+ messages in thread
From: Bossom, John @ 2000-07-12  7:34 UTC (permalink / raw)
  To: 'Thomas Sailer', Bossom, John; +Cc: pthreads-win32

Now, originally I implemented the pthread_cancel mechanism
with Microsoft's SEH (Structured Exception Handling)
and internally the BAD DEED is being thrown using this
mechanism and being caught by the thread start routine.

You should check to see if someone changed the thread
start routine to use the C++ exception mechanism.

The drawback of SEH is that it doesn't work well
with C++ as it bypasses the C++ stack unwinding
(i.e. calling destructors).

This could be handled by using a hook function that
maps SEH into C++ exceptions and using C++ exception
handling in your mainline for your thread. You'll
have to do some reading on providing the hook in
the Microsoft documentation. (I haven't done this
but it seems like a good theory anyway ;^)

John.

-----Original Message-----
From: Thomas Sailer [ mailto:sailer@ife.ee.ethz.ch ]
Sent: Wednesday, July 12, 2000 7:21 AM
To: Bossom, John
Cc: pthreads-win32@sourceware.cygnus.com
Subject: Re: cancelling


"Bossom, John" wrote:

> Check to see if the code base for pthread is wrapping
> an exception handler around your thread mainline
> (the original code had an internal routine called "threadStart"
> which used Microsoft's Structured Exception Handling for catching all
> exceptions raised in your thread.)

The thread I'm trying to cancel was created with pthread_create,
and internally the thread routine is started through
_pthread_threadStart, which should be fine.

The thread that tries to cancel is the initial thread, i.e.
the one that called _main.

> Now, your thread is recognizing the cancel (the exception
> hex value is human readable: BAD DEED) and should have

I thought that the constant wasn't chosen arbitrarily :))

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread
* RE: cancelling
@ 2000-07-10  9:35 Bossom, John
  2000-07-12  4:21 ` cancelling Thomas Sailer
  0 siblings, 1 reply; 7+ messages in thread
From: Bossom, John @ 2000-07-10  9:35 UTC (permalink / raw)
  To: 'Thomas Sailer', pthreads-win32

Check to see if the code base for pthread is wrapping
an exception handler around your thread mainline
(the original code had an internal routine called "threadStart"
which used Microsoft's Structured Exception Handling for catching all
exceptions raised in your thread.)
The cancel mechanism was implemented using this strategy.
Now, your thread is recognizing the cancel (the exception
hex value is human readable: BAD DEED) and should have
been caught by the threadStart wrapper, which would have
gracefully shut down your thread.

I am not familiar with the code base anymore so you will
have to ask others... ie Ross

-----Original Message-----
From: Thomas Sailer [ mailto:sailer@ife.ee.ethz.ch ]
Sent: Monday, July 10, 2000 11:55 AM
To: pthreads-win32@sourceware.cygnus.com
Subject: cancelling


I'm trying to cancel a thread that is blocking
in pthread_cond_wait. When I do this, I get:
gdb: unknown target exception 0xebaddeed at 0x77e79b01

I'm using the precompiled snapshot 1999-11-02,
the rest of the program is compiled with the current
(as of two weeks ago) cygwin gcc (with -mno-cygwin).

What am I missing?

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread
* cancelling
@ 2000-07-10  8:55 Thomas Sailer
  0 siblings, 0 replies; 7+ messages in thread
From: Thomas Sailer @ 2000-07-10  8:55 UTC (permalink / raw)
  To: pthreads-win32

I'm trying to cancel a thread that is blocking
in pthread_cond_wait. When I do this, I get:
gdb: unknown target exception 0xebaddeed at 0x77e79b01

I'm using the precompiled snapshot 1999-11-02,
the rest of the program is compiled with the current
(as of two weeks ago) cygwin gcc (with -mno-cygwin).

What am I missing?

Tom

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2000-07-12 23:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-07-12  7:34 cancelling Bossom, John
2000-07-12  8:44 ` cancelling Lorin Hochstein
2000-07-12 10:25 ` cancelling Thomas Sailer
2000-07-12 23:24   ` cancelling Ross Johnson
  -- strict thread matches above, loose matches on Subject: below --
2000-07-10  9:35 cancelling Bossom, John
2000-07-12  4:21 ` cancelling Thomas Sailer
2000-07-10  8:55 cancelling Thomas Sailer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).