public inbox for pthreads-win32@sourceware.org
 help / color / mirror / Atom feed
* RE: Way to wake up sleeping threads?
@ 2003-01-10 19:42 Bossom, John
  0 siblings, 0 replies; 4+ messages in thread
From: Bossom, John @ 2003-01-10 19:42 UTC (permalink / raw)
  To: 'Roy Riggs', pthreads-win32


Use a pthread_condition variable with a timeout value equal to
your timeout value (granted, you have to take the absolute time
and map it to relative time)

post to this condition to prematurely wake it up... It'll wake up
on it's own if the timeout expires.

(That is, if the pthread-win32 implements the timeout on condition
variables ;^)

-----Original Message-----
From: Roy Riggs [mailto:rriggs@edgenet.com]
Sent: Friday, January 10, 2003 2:29 PM
To: pthreads-win32@sources.redhat.com
Subject: RE: Way to wake up sleeping threads?



What I meant by sleeping was the thread has called sleep(999).
I would hate to have to put it in some kind of a polling loop.

I guess we'll have to investigate rewriting this to use seg_wait() instead,
thanks for the tip!

Cheers,
Roy

-------------------------------------
Roy Riggs
Director, Software Development
Edgenet Inc.
w: 615.234.3836
e: rriggs@edgenet.com <mailto:rriggs@edgenet.com>


NOTICE: This email and any attached files are confidential and intended
solely for the use of the addressee. If you have received this email in
error, please notify the sender and delete it immediately, without
disclosing or using its contents for any purpose. Edgenet Inc accepts no
liability for any damage caused by any virus transmitted by this email.



-----Original Message-----
From: pthreads-win32-owner@sources.redhat.com
[mailto:pthreads-win32-owner@sources.redhat.com]On Behalf Of Bossom,
John
Sent: Friday, January 10, 2003 1:22 PM
To: 'Roy Riggs'; pthreads-win32@sources.redhat.com
Subject: RE: Way to wake up sleeping threads?


What do you mean by "sleeping"?

If you are blocked on a socket, then use a timeout for the
socket and check a flag to see if you should quit, else, block
on the socket again.

Otherwise, use a synchronization object, such as a semaphore
to "sleep" and post to it to wake it up.

pthread_kill involves signal handling which does not map well
to win32.

-----Original Message-----
From: Roy Riggs [mailto:rriggs@edgenet.com]
Sent: Friday, January 10, 2003 2:12 PM
To: pthreads-win32@sources.redhat.com
Subject: Way to wake up sleeping threads?



I'm trying to port some code that was using pthread_kill() to wake up a
sleeping thread.

Is there some other means of doing this with this implementation of
pthreads, since it doesn't support pthread_kill() ?

Thanks,
Roy

-------------------------------------
Roy Riggs
Director, Software Development
Edgenet Inc.
w: 615.234.3836
e: rriggs@edgenet.com <mailto:rriggs@edgenet.com>


NOTICE: This email and any attached files are confidential and intended
solely for the use of the addressee. If you have received this email in
error, please notify the sender and delete it immediately, without
disclosing or using its contents for any purpose. Edgenet Inc accepts no
liability for any damage caused by any virus transmitted by this email.

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

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

* RE: Way to wake up sleeping threads?
  2003-01-10 19:23 Bossom, John
@ 2003-01-10 19:36 ` Roy Riggs
  0 siblings, 0 replies; 4+ messages in thread
From: Roy Riggs @ 2003-01-10 19:36 UTC (permalink / raw)
  To: pthreads-win32


What I meant by sleeping was the thread has called sleep(999).
I would hate to have to put it in some kind of a polling loop.

I guess we'll have to investigate rewriting this to use seg_wait() instead,
thanks for the tip!

Cheers,
Roy

-------------------------------------
Roy Riggs
Director, Software Development
Edgenet Inc.
w: 615.234.3836
e: rriggs@edgenet.com <mailto:rriggs@edgenet.com>


NOTICE: This email and any attached files are confidential and intended
solely for the use of the addressee. If you have received this email in
error, please notify the sender and delete it immediately, without
disclosing or using its contents for any purpose. Edgenet Inc accepts no
liability for any damage caused by any virus transmitted by this email.



-----Original Message-----
From: pthreads-win32-owner@sources.redhat.com
[mailto:pthreads-win32-owner@sources.redhat.com]On Behalf Of Bossom,
John
Sent: Friday, January 10, 2003 1:22 PM
To: 'Roy Riggs'; pthreads-win32@sources.redhat.com
Subject: RE: Way to wake up sleeping threads?


What do you mean by "sleeping"?

If you are blocked on a socket, then use a timeout for the
socket and check a flag to see if you should quit, else, block
on the socket again.

Otherwise, use a synchronization object, such as a semaphore
to "sleep" and post to it to wake it up.

pthread_kill involves signal handling which does not map well
to win32.

-----Original Message-----
From: Roy Riggs [mailto:rriggs@edgenet.com]
Sent: Friday, January 10, 2003 2:12 PM
To: pthreads-win32@sources.redhat.com
Subject: Way to wake up sleeping threads?



I'm trying to port some code that was using pthread_kill() to wake up a
sleeping thread.

Is there some other means of doing this with this implementation of
pthreads, since it doesn't support pthread_kill() ?

Thanks,
Roy

-------------------------------------
Roy Riggs
Director, Software Development
Edgenet Inc.
w: 615.234.3836
e: rriggs@edgenet.com <mailto:rriggs@edgenet.com>


NOTICE: This email and any attached files are confidential and intended
solely for the use of the addressee. If you have received this email in
error, please notify the sender and delete it immediately, without
disclosing or using its contents for any purpose. Edgenet Inc accepts no
liability for any damage caused by any virus transmitted by this email.

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

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

* RE: Way to wake up sleeping threads?
@ 2003-01-10 19:23 Bossom, John
  2003-01-10 19:36 ` Roy Riggs
  0 siblings, 1 reply; 4+ messages in thread
From: Bossom, John @ 2003-01-10 19:23 UTC (permalink / raw)
  To: 'Roy Riggs', pthreads-win32

What do you mean by "sleeping"?

If you are blocked on a socket, then use a timeout for the
socket and check a flag to see if you should quit, else, block
on the socket again.

Otherwise, use a synchronization object, such as a semaphore
to "sleep" and post to it to wake it up.

pthread_kill involves signal handling which does not map well
to win32.

-----Original Message-----
From: Roy Riggs [mailto:rriggs@edgenet.com]
Sent: Friday, January 10, 2003 2:12 PM
To: pthreads-win32@sources.redhat.com
Subject: Way to wake up sleeping threads?



I'm trying to port some code that was using pthread_kill() to wake up a
sleeping thread.

Is there some other means of doing this with this implementation of
pthreads, since it doesn't support pthread_kill() ?

Thanks,
Roy

-------------------------------------
Roy Riggs
Director, Software Development
Edgenet Inc.
w: 615.234.3836
e: rriggs@edgenet.com <mailto:rriggs@edgenet.com>


NOTICE: This email and any attached files are confidential and intended
solely for the use of the addressee. If you have received this email in
error, please notify the sender and delete it immediately, without
disclosing or using its contents for any purpose. Edgenet Inc accepts no
liability for any damage caused by any virus transmitted by this email.

This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

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

* Way to wake up sleeping threads?
@ 2003-01-10 19:19 Roy Riggs
  0 siblings, 0 replies; 4+ messages in thread
From: Roy Riggs @ 2003-01-10 19:19 UTC (permalink / raw)
  To: pthreads-win32


I'm trying to port some code that was using pthread_kill() to wake up a
sleeping thread.

Is there some other means of doing this with this implementation of
pthreads, since it doesn't support pthread_kill() ?

Thanks,
Roy

-------------------------------------
Roy Riggs
Director, Software Development
Edgenet Inc.
w: 615.234.3836
e: rriggs@edgenet.com <mailto:rriggs@edgenet.com>


NOTICE: This email and any attached files are confidential and intended
solely for the use of the addressee. If you have received this email in
error, please notify the sender and delete it immediately, without
disclosing or using its contents for any purpose. Edgenet Inc accepts no
liability for any damage caused by any virus transmitted by this email.

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

end of thread, other threads:[~2003-01-10 19:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-01-10 19:42 Way to wake up sleeping threads? Bossom, John
  -- strict thread matches above, loose matches on Subject: below --
2003-01-10 19:23 Bossom, John
2003-01-10 19:36 ` Roy Riggs
2003-01-10 19:19 Roy Riggs

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).