chicken-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] thread blocking reason


From: Felix Winkelmann
Subject: Re: [Chicken-users] thread blocking reason
Date: Wed, 16 Apr 2003 10:13:15 +0200
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.0.0) Gecko/20020530

Joerg F. Wittenberger wrote:
Hi Felix,

I have a (thread-list) function which I'd like to extent to display
the reason, why threads are blocked.  But somehow I can't figure out,
how to derive the info.  Apparently the thread structure carries just
'blocked or some other state.

I'm not really in favor of changing the structure to include yet
another field, which, at the end, can become a bug source.  The
function is a debugging aid and may take it's time.  But how would you
go about it?


You can investigate slot #11 of a thread (via `(##sys#slot THREAD 11)):

- If the thread is waiting for another thread (thread-join!), it
  contains the waited for thread.
- If waiting for timeout, it contains the timeout value.
- If waiting for I/O, it contains a pair (FD . FLAG),
  where FD is the file-descriptor, and FLAG is true, when waiting
  for input (or false, when waiting for output).

Note that it's currently not possible to find out which threads
are suspended (thread-suspend!) or blocked for mutexes.


cheers,
felix





reply via email to

[Prev in Thread] Current Thread [Next in Thread]