Bug #176

Missing symbol in lwkt_thread.c

Added by wa1ter almost 8 years ago. Updated over 7 years ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:-

Description

lwkt_relalltokens is defined in thread.h, but because
of an #ifdef in lwkt_thread.c, thread2.h is included
instead of thread.h. Are these backwards in the #ifdef?

History

#1 Updated by dillon almost 8 years ago

:
:lwkt_relalltokens is defined in thread.h, but because
:of an #ifdef in lwkt_thread.c, thread2.h is included
:instead of thread.h. Are these backwards in the #ifdef?

It's just an SMP vs non-SMP build issue. lwkt_getalltokens()
and lwkt_relalltokens() need to exist for both builds and
they don't. I'll get the UP build working again.

-Matt
Matthew Dillon
<>

#2 Updated by dillon almost 8 years ago

:
:lwkt_relalltokens is defined in thread.h, but because
:of an #ifdef in lwkt_thread.c, thread2.h is included
:instead of thread.h. Are these backwards in the #ifdef?

Ouch. It's a bit more complicated then I originally thought. Or
actually, less complicated then I thought.

The token code still has the same semantics as it did before, but
on SMP systems I am using an active spinlock now instead of a
passive per-cpu lock. When I originally coded it I forgot that
the spinlock routines would not work as interlocks on UP builds
(because they are just degenerate NOPs on UP builds).

But, at the same time, on a UP system there is no need to track tokens
on a per-thread basis and no need to have a spinlock or even *DO*
anything when a thread switch occurs. Since by definition a held token
is only 'active' when the thread holding it is running, the only thing
that is needed on a UP system is to check whether a token is being held
by a preempted thread. Neither lwkt_getalltokens() or lwkt_relalltokens()
needs to be called at all on a UP system.

I am cleaning it all up now and will commit a fix shortly.

-Matt
Matthew Dillon
<>

Also available in: Atom PDF