<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user">
    <title>gmane.comp.lib.state-threads.user</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/99"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/98"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/97"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/96"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/95"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/94"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/93"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/92"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/91"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/90"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/89"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/88"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/87"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/86"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/85"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/99">
    <title>Re: _st_epoll_dispatch firing too often</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/99</link>
    <description>&lt;pre&gt;This was on two different Linux boxes, one 2.6.25.11-97.fc9.x86_64, and another 2.6.35.14-96.fc14.i686.  No VMs.
I've just tried on another box running 3.2.6-3.fc16.x86_64, and that seems to work correctly just like yours.
Perhaps it's just specific Linux kernels. I don't think anyone's got the patience to sit there and test which kernels don't play well.


----- Original Message -----
From: Michael Abbott &amp;lt;yahmja&amp;lt; at &amp;gt;yahoo.com&amp;gt;
To: CN &amp;lt;cuongn7&amp;lt; at &amp;gt;yahoo.com.au&amp;gt;
Cc: "state-threads-users&amp;lt; at &amp;gt;lists.sourceforge.net" &amp;lt;state-threads-users&amp;lt; at &amp;gt;lists.sourceforge.net&amp;gt;
Sent: Wednesday, 5 December 2012 5:11 AM
Subject: Re: [ST-users] _st_epoll_dispatch firing too often


On what OS?  Your test program works fine for me on Linux and OS X:

1354644462832661 MAIN diff = 1002671
1354644463832701 MAIN diff = 999990
1354644464832747 MAIN diff = 1000027
1354644465832793 MAIN diff = 1000026
1354644466832836 MAIN diff = 1000020

(I made it print the current st_utime() instead of the pointers, in the first column.)
The "ST diff" messages neve&lt;/pre&gt;</description>
    <dc:creator>CN</dc:creator>
    <dc:date>2012-12-04T23:33:54</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/98">
    <title>Re: _st_epoll_dispatch firing too often</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/98</link>
    <description>&lt;pre&gt;
On what OS?  Your test program works fine for me on Linux and OS X:

1354644462832661 MAIN diff = 1002671
1354644463832701 MAIN diff = 999990
1354644464832747 MAIN diff = 1000027
1354644465832793 MAIN diff = 1000026
1354644466832836 MAIN diff = 1000020

(I made it print the current st_utime() instead of the pointers, in the first column.)
The "ST diff" messages never even appear.

Are you running in a virtual machine?  VMs have been known to fire timers at unexpected times.
------------------------------------------------------------------------------
LogMeIn Rescue: Anywhere, Anytime Remote support for IT. Free Trial
Remotely access PCs and mobile devices and provide instant support
Improve your efficiency, and focus on delivering more value-add services
Discover what IT Professionals Know. Rescue delivers
http://p.sf.net/sfu/logmein_12329d2d
&lt;/pre&gt;</description>
    <dc:creator>Michael Abbott</dc:creator>
    <dc:date>2012-12-04T18:11:48</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/97">
    <title>_st_epoll_dispatch firing too often</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/97</link>
    <description>&lt;pre&gt;_st_epoll_dispatch seems to fire too often when the sleepq is not empty. 
My guess is that it has something to do with granularity.
Here's some basic code to reproduce:

#include &amp;lt;stdio.h&amp;gt;
#include "st.h"
int main(int argc, char *argv[])

{
    st_utime_t t1, t2;
    st_set_eventsys(ST_EVENTSYS_ALT);
    st_init();
    for (;;) {

        t1 = st_utime();
        st_sleep(1);
        t2 = st_utime();
        fprintf(stderr, "%p MAIN diff = %llu\n", st_thread_self(), t2 - t1);
    }
    return 0;

}


And add some logging to event.c &amp;lt; at &amp;gt; line 1244.
ie.
1243:  timeout = (int) (min_timeout / 1000);
1244:  if (timeout == 0 &amp;amp;&amp;amp; _ST_SLEEPQ-&amp;gt;due &amp;gt; _ST_LAST_CLOCK)
1245:      fprintf(stderr, "%p ST   diff=%llu\n", _ST_SLEEPQ, _ST_SLEEPQ-&amp;gt;due - _ST_LAST_CLOCK);
1245: }

You'll also need "#include &amp;lt;stdio.h&amp;gt;" .


If you run the test, you'll see something like:
0x805f068 MAIN diff = 999992
0x805f068 ST   diff=241
0x805f068 ST   diff=222
0x805f068 ST   diff=210
0x805f068 ST   diff=199&lt;/pre&gt;</description>
    <dc:creator>CN</dc:creator>
    <dc:date>2012-12-03T01:48:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/96">
    <title>Why do the st_recvmsg()/st_sendmsg() docs refer to UDPsockets?</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/96</link>
    <description>&lt;pre&gt;I'm curious as to why the docs constain st_sendmsg() and st_recvmsg()
to UDP?

To quote from
http://state-threads.sourceforge.net/docs/reference.html#sendmsg "A
file descriptor object identifier (see st_netfd_t) representing a UDP
socket"

But I don't see anything in the st code that requires this constraint,
furthermore I've long used st_sendmsg() and st_recvmsg() on TCP
sockets as it's the only way to do an inter-process fdpass with this
sort of code:

  control-&amp;gt;cmsg_level = SOL_SOCKET;
  control-&amp;gt;cmsg_type = SCM_RIGHTS;

My guess is that it's just an historical accident in the docs that
might have been cloned from st_sendto()/st_recvfrom() function - which
are constrained to UDP.


Mark.

------------------------------------------------------------------------------
Learn Windows Azure Live!  Tuesday, Dec 13, 2011
Microsoft is holding a special Learn Windows Azure training event for 
developers. It will provide a great way to learn Windows Azure and what it 
provides. You can attend the event by watching&lt;/pre&gt;</description>
    <dc:creator>Mark Delany</dc:creator>
    <dc:date>2011-12-18T03:06:01</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/95">
    <title>STL and weird valgrind warnings</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/95</link>
    <description>&lt;pre&gt;Hi guys,

Valgrind outputs very weird warnings. Please check the log file I've
attached. The properties of the threads are correct when you print them and
they work as expected. There is no stack smashing/overflowing.

Tests are made with the  latest version of STL.

Regards,
H. Hamdi
------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1_______________________________________________
State-threads-users mailing list
State-threads-users&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/state-threads-users
&lt;/pre&gt;</description>
    <dc:creator>Hamdi Hamdi</dc:creator>
    <dc:date>2011-11-06T09:49:34</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/94">
    <title>Re: Terminate threads</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/94</link>
    <description>&lt;pre&gt;
Programs using State Threads should fork before creating threads.  One
idiom is to have a master process which forks and uses no threads
itself, while the child processes manage their own threads.


State Threads does not provide a way to "kill" a thread.  Instead each
thread can check a flag in its main loop to see whether it should exit.
The flag can be a global variable or a pointer passed as the arg to
st_thread_create().  For threads which are blocking,
st_thread_interrupt() wakes them up but does not kill them.

Your "IAmSpartacus" example is close but I'd code it this way:

int run_logger = 1;
st_thread_t logger_thread = st_thread_create(..., &amp;amp;run_logger, ...);
...
if (fork() == 0) {
  run_logger = 0;
  st_thread_interrupt(logger_thread);
}
...
static void *flush_acclog_buffer(int *keep_running)
{
  while (*keep_running) {
    if (st_sleep(ACCLOG_FLUSH_INTERVAL) == 0)
      logbuf_flush();
  }
  return NULL;
}

------------------------------------------------------------------------------
The demand &lt;/pre&gt;</description>
    <dc:creator>Michael Abbott</dc:creator>
    <dc:date>2011-10-20T16:46:51</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/93">
    <title>Terminate threads</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/93</link>
    <description>&lt;pre&gt;Hi All,

I have a process A that creates a thread to do logging, then forks another process B.

How do I get B to terminate any existing inherited threads such as the logging thread.

Using the "server.c" as an example, where flush_acclog_buffer()  is running in a thread, is there something cleaner than than:

int IAmSpartacus = 1;

...
IAmSpartacus = 0;
if (fork() &amp;gt; 0) {
   IAmSpartacus = 1;
}
...


static void *flush_acclog_buffer(void *arg)
{
    for ( ; IAmSpartacus == 1 ; ) {
st_sleep(ACCLOG_FLUSH_INTERVAL);
logbuf_flush();
    }
    return NULL;

}

------------------------------------------------------------------------------
The demand for IT networking professionals continues to grow, and the
demand for specialized networking skills is growing even more rapidly.
Take a complimentary Learning&amp;lt; at &amp;gt;Ciosco Self-Assessment and learn 
about Cisco certifications, training, and career opportunities. 
http://p.sf.net/sfu/cisco-dev2dev
&lt;/pre&gt;</description>
    <dc:creator>Cuong Nguyen</dc:creator>
    <dc:date>2011-10-20T12:45:18</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/92">
    <title>Question in _st_stack_new</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/92</link>
    <description>&lt;pre&gt;Hi Dear ST Developers and Users,

I am reading ST 1.9's source has encounter a piece of code that I can't
figure out for a week.

In stk.c,

in the body of the function

_st_stack_t *_st_stack_new(int stack_size)

I understand this function is to allocate memory space for the stack. And
update the stack records.

There is this piece

for (qp = _st_free_stacks.next; qp != &amp;amp;_st_free_stacks; qp = qp-&amp;gt;next)
 //when is _st_free_stack.next!= qp?
{
ts = _ST_THREAD_STACK_PTR(qp);
/*
Here I lookup what _ST_THREAD_STACK_PTR does and found

#define offsetof(type, identifier) (/***/ (size_t)&amp;amp;(/**/( (type
*)0)-&amp;gt;identifier/**/) /***/)
It looks like this macro finds a instance of "_st_stack_t"'s element "links"
's address and cast it into size_t type?
I am totally confused about this! Cast address 0 points to _st_stack_t type
variable, but the space is never allocated yet. How does this work?


#define _ST_THREAD_STACK_PTR(_qp)   \
    (/**/ (_st_stack_t *)(/***/ (char*)(_qp) - offsetof(_st_stack_t, links)
/***/) /**/)
cas&lt;/pre&gt;</description>
    <dc:creator>Alfred Zhong</dc:creator>
    <dc:date>2011-09-21T01:40:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/91">
    <title>Re: problem of stack size in st_thread_create()</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/91</link>
    <description>&lt;pre&gt;Oh my god!

+ _ST_PAGE_SIZE - 1

if stk_size is just x times of the _ST_PAGE_SIZE, the integer division will
return exactly x b/c of the -1.

if stk_size is smaller than x times of _ST_PAGE_SIZE, the integer division
will return exactly x, and ignore the remaining &amp;gt;x but &amp;lt;x+1

That is smart!
If the purpose is in the comment or docs will be better to understand

Thanks a lot, John!

Alfred

On Wed, Aug 10, 2011 at 1:11 PM, John Newton &amp;lt;jnewton&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
State-threads-users mailing list
State-threads-users&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/state-threads-users
&lt;/pre&gt;</description>
    <dc:creator>Alfred Zhong</dc:creator>
    <dc:date>2011-08-10T17:32:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/90">
    <title>Re: problem of stack size in st_thread_create()</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/90</link>
    <description>&lt;pre&gt;The line you are asking about is a "round up" to the next page size
calculation.

For example, if getpagesize() returns 4096, and the "stk_size" parameter is
10,000 it would round up to the next even page size. (the division is doing
integer math)

Hope this helps!

On Wed, Aug 10, 2011 at 9:06 AM, Alfred Zhong &amp;lt;alfchung02&amp;lt; at &amp;gt;gmail.com&amp;gt; wrote:

------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
State-threads-users mailing list
State-threads-users&amp;lt; at &amp;gt;lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/state-threads-users
&lt;/pre&gt;</description>
    <dc:creator>John Newton</dc:creator>
    <dc:date>2011-08-10T17:11:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/89">
    <title>problem of stack size in st_thread_create()</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/89</link>
    <description>&lt;pre&gt;Hi,
I am new to state thread library and am reading the source code of ST to
study implementation of threading.

in the st_thread_create() function

there is this code piece

if (stk_size == 0)
    stk_size = ST_DEFAULT_STACK_SIZE;  // I know this is to set the stack
size to a default size, if the input size is 0
  stk_size = ((stk_size + _ST_PAGE_SIZE - 1) / _ST_PAGE_SIZE) *
_ST_PAGE_SIZE; //what does this mean?

Look like it equals (stk_size + ST_PAGE_SIZE -1) unless the previous
division gives 0.

I am totally confused and can't find the answer in the code or the docs,
please help!

Thanks a lot!
Alfred
------------------------------------------------------------------------------
uberSVN's rich system and user administration capabilities and model 
configuration take the hassle out of deploying and managing Subversion and 
the tools developers use with it. Learn more about uberSVN and get a free 
download at:  http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
State-thre&lt;/pre&gt;</description>
    <dc:creator>Alfred Zhong</dc:creator>
    <dc:date>2011-08-10T16:06:00</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/88">
    <title>Re: Multiple asynchronous operations</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/88</link>
    <description>&lt;pre&gt;
Yes and no.  Yes, in that st_poll() does directly support waiting for
I/O only.  No, because other async operations can map to I/O by reading
and writing a pipe or socketpair.  For instance, user-defined lock
functions could write something to a pipe whenever they lock or unlock a
lock, and another thread could poll and read from the pipe to learn when
such actions happen.  This is how we recommend translating UNIX signals
to I/O operations too; see
        http://state-threads.sourceforge.net/docs/notes.html


------------------------------------------------------------------------------
Come build with us! The BlackBerry&amp;amp;reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&amp;amp;#45;12, 2009. Register now&amp;amp;#33;
http://p.sf.net/sfu/devconf
&lt;/pre&gt;</description>
    <dc:creator>Michael Abbott</dc:creator>
    <dc:date>2009-09-17T16:34:28</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/87">
    <title>Re: Multiple asynchronous operations</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/87</link>
    <description>&lt;pre&gt;
Correct me if I'm wrong, but that only applies to I/O, as opposed to
asynchronous operations in general, such as mutex locking, sleeping
(though I know there's a timeout parameter already for this), or any
other user-defined asynchronous operation.
&lt;/pre&gt;</description>
    <dc:creator>Yang Zhang</dc:creator>
    <dc:date>2009-09-16T20:12:21</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/86">
    <title>Re: Multiple asynchronous operations</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/86</link>
    <description>&lt;pre&gt;
st_poll()

------------------------------------------------------------------------------
Come build with us! The BlackBerry&amp;amp;reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&amp;amp;#45;12, 2009. Register now&amp;amp;#33;
http://p.sf.net/sfu/devconf
&lt;/pre&gt;</description>
    <dc:creator>Michael Abbott</dc:creator>
    <dc:date>2009-09-16T18:54:27</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.lib.state-threads.user/85">
    <title>Multiple asynchronous operations</title>
    <link>http://permalink.gmane.org/gmane.comp.lib.state-threads.user/85</link>
    <description>&lt;pre&gt;What would be the easiest way to be able to wait on multiple
asynchronous operations without having to create a thread per
operation? I'm trying to write my own primitives for this, but I'm not
sure it's possible without modifying ST itself. Any thoughts would be
greatly appreciated.
&lt;/pre&gt;</description>
    <dc:creator>Yang Zhang</dc:creator>
    <dc:date>2009-09-14T18:40:40</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.lib.state-threads.user">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.lib.state-threads.user</link>
  </textinput>
</rdf:RDF>
