[issue210650] [HP-UX] python with-threads core-dumps (PR#342)

2022-04-10 Thread admin


Change by admin :


___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue210650] [HP-UX] python with-threads core-dumps (PR#342)

2022-04-10 Thread admin


Change by admin :


--
github: None -> 32721

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19576] "Non-Python created threads" documentation doesn't mention PyEval_InitThreads()

2016-01-03 Thread tzickel

tzickel added the comment:

I think that the document regarding PyGILState_Ensure and PyEval_InitThreads 
should be clarified better, written in issue #26003

--
nosy: +tzickel

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19576] Non-Python created threads documentation doesn't mention PyEval_InitThreads()

2014-05-04 Thread Jiong Du

Jiong Du added the comment:

this patch made a new issue20891

--
nosy: +lolynx

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19576
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19576] Non-Python created threads documentation doesn't mention PyEval_InitThreads()

2013-12-12 Thread STINNER Victor

STINNER Victor added the comment:

So Antoine, what do you think of the fix?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19576
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19576] Non-Python created threads documentation doesn't mention PyEval_InitThreads()

2013-12-12 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Looks good to me.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19576
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19576] Non-Python created threads documentation doesn't mention PyEval_InitThreads()

2013-12-12 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dc4e805ec68a by Victor Stinner in branch 'default':
Close #19576: PyGILState_Ensure() now initializes threads. At startup, Python
http://hg.python.org/cpython/rev/dc4e805ec68a

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19576
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19576] Non-Python created threads documentation doesn't mention PyEval_InitThreads()

2013-11-14 Thread STINNER Victor

STINNER Victor added the comment:

 Perhaps we can fix PyGILState to call PyEval_InitThreads automatically?

Yes, I had the same idea. Here is a patch to call PyEval_InitThreads() in 
PyGILState_Ensure() for new threads.

--
keywords: +patch
Added file: http://bugs.python.org/file32609/PyGILState_Ensure.patch

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19576
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19576] Non-Python created threads documentation doesn't mention PyEval_InitThreads()

2013-11-13 Thread STINNER Victor

New submission from STINNER Victor:

While working on a unit test for the issue #14432, I hit a bug. My C thread got 
the GIL with PyGILState_Ensure(), but it was strange because the main Python 
thread also had the GIL...

Then I saw that gil_created() returned false. The solution is to call 
PyEval_InitThreads() to create the GIL.

I was reading Non-Python created threads documentation, but this section 
doesn't mention PyEval_InitThreads().

I don't know if it's something new in Python 3.2 with the new GIL.

--
assignee: docs@python
components: Documentation
messages: 202787
nosy: christian.heimes, docs@python, haypo, pitrou
priority: normal
severity: normal
status: open
title: Non-Python created threads documentation doesn't mention 
PyEval_InitThreads()
versions: Python 3.3, Python 3.4

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19576
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue19576] Non-Python created threads documentation doesn't mention PyEval_InitThreads()

2013-11-13 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Perhaps we can fix PyGILState to call PyEval_InitThreads automatically?

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue19576
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



Re: Should I use stackless python or threads?

2009-03-07 Thread John Nagle

Minesh Patel wrote:

On Fri, Mar 6, 2009 at 3:16 PM, Jean-Paul Calderone exar...@divmod.com wrote:

On Fri, 6 Mar 2009 14:50:51 -0800, Minesh Patel min...@gmail.com wrote:

I am trying to figure out the best approach to solve this problem:

I want to poll various directories(can be run in the main thread).
Once I notice a file has been added to any directory, I grab a lock,
spawn a thread to go perform the necessary actions, and then release
the lock.

That's not a description of a problem.  That's a description of a potential
solution.  What problem are you trying to solve?



I have a build system that is outputting various forms of
installations in a particular directory structure, e.g. /pxe-installs,
/iso-install, /dd-installs, etc...


   If this is under Windows, there's a Windows function to monitor a
directory for changes.  This is far more efficient than polling.

John Nagle
--
http://mail.python.org/mailman/listinfo/python-list


Re: Should I use stackless python or threads?

2009-03-07 Thread MRAB

John Nagle wrote:

Minesh Patel wrote:
On Fri, Mar 6, 2009 at 3:16 PM, Jean-Paul Calderone 
exar...@divmod.com wrote:
On Fri, 6 Mar 2009 14:50:51 -0800, Minesh Patel min...@gmail.com 
wrote:

I am trying to figure out the best approach to solve this problem:

I want to poll various directories(can be run in the main thread).
Once I notice a file has been added to any directory, I grab a lock,
spawn a thread to go perform the necessary actions, and then release
the lock.
That's not a description of a problem.  That's a description of a 
potential

solution.  What problem are you trying to solve?



I have a build system that is outputting various forms of
installations in a particular directory structure, e.g. /pxe-installs,
/iso-install, /dd-installs, etc...


   If this is under Windows, there's a Windows function to monitor a
directory for changes.  This is far more efficient than polling.


You should be aware, however, that this applies only to Windows folders.
If you want to monitor, say, a shared Mac folder from a Windows PC then
that Windows function will fail and you'll have to fall back to polling.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Should I use stackless python or threads?

2009-03-07 Thread Diez B. Roggisch

John Nagle schrieb:

Minesh Patel wrote:
On Fri, Mar 6, 2009 at 3:16 PM, Jean-Paul Calderone 
exar...@divmod.com wrote:
On Fri, 6 Mar 2009 14:50:51 -0800, Minesh Patel min...@gmail.com 
wrote:

I am trying to figure out the best approach to solve this problem:

I want to poll various directories(can be run in the main thread).
Once I notice a file has been added to any directory, I grab a lock,
spawn a thread to go perform the necessary actions, and then release
the lock.
That's not a description of a problem.  That's a description of a 
potential

solution.  What problem are you trying to solve?



I have a build system that is outputting various forms of
installations in a particular directory structure, e.g. /pxe-installs,
/iso-install, /dd-installs, etc...


   If this is under Windows, there's a Windows function to monitor a
directory for changes.  This is far more efficient than polling.


For various *nixes there is a similar service called FAM available. 
There seems to be a somewhat dated python version, but as it's bundled 
with ubuntu intrepid, it should be ok.


http://python-fam.sourceforge.net/

Diez
--
http://mail.python.org/mailman/listinfo/python-list


Should I use stackless python or threads?

2009-03-06 Thread Minesh Patel
I am trying to figure out the best approach to solve this problem:

I want to poll various directories(can be run in the main thread).
Once I notice a file has been added to any directory, I grab a lock,
spawn a thread to go perform the necessary actions, and then release
the lock.

-- 
Thanks for the help,
Minesh Patel
--
http://mail.python.org/mailman/listinfo/python-list


Re: Should I use stackless python or threads?

2009-03-06 Thread Jean-Paul Calderone

On Fri, 6 Mar 2009 14:50:51 -0800, Minesh Patel min...@gmail.com wrote:

I am trying to figure out the best approach to solve this problem:

I want to poll various directories(can be run in the main thread).
Once I notice a file has been added to any directory, I grab a lock,
spawn a thread to go perform the necessary actions, and then release
the lock.


That's not a description of a problem.  That's a description of a 
potential solution.  What problem are you trying to solve?




--
Thanks for the help,
Minesh Patel
--
http://mail.python.org/mailman/listinfo/python-list


--
http://mail.python.org/mailman/listinfo/python-list


Re: Should I use stackless python or threads?

2009-03-06 Thread Minesh Patel
On Fri, Mar 6, 2009 at 3:16 PM, Jean-Paul Calderone exar...@divmod.com wrote:
 On Fri, 6 Mar 2009 14:50:51 -0800, Minesh Patel min...@gmail.com wrote:

 I am trying to figure out the best approach to solve this problem:

 I want to poll various directories(can be run in the main thread).
 Once I notice a file has been added to any directory, I grab a lock,
 spawn a thread to go perform the necessary actions, and then release
 the lock.

 That's not a description of a problem.  That's a description of a potential
 solution.  What problem are you trying to solve?


I have a build system that is outputting various forms of
installations in a particular directory structure, e.g. /pxe-installs,
/iso-install, /dd-installs, etc...

I need to monitor each directory for the latest install, take it and
go perform some tests on a specific machine. I would like these
testing tasks to run concurrently for the obvious reasons.

Thanks again for the help,
Minesh
--
http://mail.python.org/mailman/listinfo/python-list


Re: Should I use stackless python or threads?

2009-03-06 Thread Lie Ryan

Minesh Patel wrote:

On Fri, Mar 6, 2009 at 3:16 PM, Jean-Paul Calderone exar...@divmod.com wrote:

On Fri, 6 Mar 2009 14:50:51 -0800, Minesh Patel min...@gmail.com wrote:

I am trying to figure out the best approach to solve this problem:

I want to poll various directories(can be run in the main thread).
Once I notice a file has been added to any directory, I grab a lock,
spawn a thread to go perform the necessary actions, and then release
the lock.

That's not a description of a problem.  That's a description of a potential
solution.  What problem are you trying to solve?



I have a build system that is outputting various forms of
installations in a particular directory structure, e.g. /pxe-installs,
/iso-install, /dd-installs, etc...

I need to monitor each directory for the latest install, take it and
go perform some tests on a specific machine. I would like these
testing tasks to run concurrently for the obvious reasons.


Why not use subprocess. For each update to the directory you spawn a new 
subprocess.

--
http://mail.python.org/mailman/listinfo/python-list


Re: Should I use stackless python or threads?

2009-03-06 Thread alex23
On Mar 7, 9:35 am, Minesh Patel min...@gmail.com wrote:
 I need to monitor each directory for the latest install, take it and
 go perform some tests on a specific machine. I would like these
 testing tasks to run concurrently for the obvious reasons.

There are two other options to consider:
 * greenlet, which has come out of the Stackless project:
http://codespeak.net/py/dist/greenlet.html
 * circuits, which comes with an iNotify driver:
http://trac.softcircuit.com.au/circuits/browser/circuits/lib/drivers/inotify_driver.py

Both of these libraries favour concurrency over threading, I believe.
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python and threads

2009-01-19 Thread vedrandekovic
On 18 sij, 21:27, Stefan Behnel stefan...@behnel.de wrote:
 vedrandeko...@yahoo.com wrote:
  and thanks for all previous help.I want to measure memory usage of
  executed python script.I'am working on windows XP.

 Could you qualify measure? Do you mean:

 a) debug (permanently high accuracy, potentially high runtime overhead)
 b) monitor (high accuracy, low/medium-resolution surveillance, no runtime
               overhead)
 c) find out (low accuracy or just max usage, no permanent observation)

 ?

 Stefan

Hello,

I want to find out , sorry for this measure.


Regards,
John
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python and threads

2009-01-19 Thread Scott David Daniels

vedrandeko...@yahoo.com said:
 ... when I run these two threads,
 I think they don't start at the same time

In response,
Diez B. Roggisch wrote:
... Even if you managed to get two threads started simultaneously 
(which the OS doesn't even offer IINM), the would soon run out of sync


And the simple way to remember this is to rember why time was made,
Time is Nature's way of keeping everything from happening at once. :-)

Just a brief humor break.
--
http://mail.python.org/mailman/listinfo/python-list


Python and threads

2009-01-18 Thread vedrandekovic
Hello again,

Thanks for previous help on Start two threads in same time it was
useful,but when I run this
two threads, I think they don't start at the same time, here is my
code snippet:


import threading

class ThreadedClass1(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)

def run(self):
a=True
while a==True:
bm=my_module.MyClass()
a=bm.get_Python_Process_Usage_Function()   #Returns True
or False

class ThreadedClass2(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)

def run(self):
os.popen(my_python_script.py)



threaded_obj = ThreadedClass1()
threaded_obj.start()
threaded_obj2 = ThreadedClass2()
threaded_obj2.start()

Regards,
John
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python and threads

2009-01-18 Thread Stefan Behnel
vedrandeko...@yahoo.com wrote:
 Thanks for previous help on Start two threads in same time it was
 useful,but when I run this
 two threads, I think they don't start at the same time

That's normal. Threading is an unpredictable concurrency pattern. Things
often don't happen the way one would want them to.

Stefan
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python and threads

2009-01-18 Thread Diez B. Roggisch

vedrandeko...@yahoo.com schrieb:

Hello again,

Thanks for previous help on Start two threads in same time it was
useful,but when I run this
two threads, I think they don't start at the same time, here is my
code snippet:


import threading

class ThreadedClass1(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)

def run(self):
a=True
while a==True:
bm=my_module.MyClass()
a=bm.get_Python_Process_Usage_Function()   #Returns True
or False

class ThreadedClass2(threading.Thread):
def __init__(self):
threading.Thread.__init__(self)

def run(self):
os.popen(my_python_script.py)



threaded_obj = ThreadedClass1()
threaded_obj.start()
threaded_obj2 = ThreadedClass2()
threaded_obj2.start()


If you want to synchronize two or more threads, you need to do so 
manually using objects like Locks, Events, Conditions and Semaphores. 
See the threading module.


Even if you managed to get two threads started simultaneously (which the 
 OS doesn't even offer IINM), the would soon run out of sync.


How about you tell us what you *want*, and we tell you if and how it's 
possible to do that.


Diez

--
http://mail.python.org/mailman/listinfo/python-list


Re: Python and threads

2009-01-18 Thread vedrandekovic
On 18 sij, 17:48, Diez B. Roggisch de...@nospam.web.de wrote:
 vedrandeko...@yahoo.com schrieb:



  Hello again,

  Thanks for previous help on Start two threads in same time it was
  useful,but when I run this
  two threads, I think they don't start at the same time, here is my
  code snippet:

  import threading

  class ThreadedClass1(threading.Thread):
      def __init__(self):
          threading.Thread.__init__(self)

      def run(self):
          a=True
          while a==True:
              bm=my_module.MyClass()
              a=bm.get_Python_Process_Usage_Function()   #Returns True
  or False

  class ThreadedClass2(threading.Thread):
      def __init__(self):
          threading.Thread.__init__(self)

      def run(self):
          os.popen(my_python_script.py)

  threaded_obj = ThreadedClass1()
  threaded_obj.start()
  threaded_obj2 = ThreadedClass2()
  threaded_obj2.start()

 If you want to synchronize two or more threads, you need to do so
 manually using objects like Locks, Events, Conditions and Semaphores.
 See the threading module.

 Even if you managed to get two threads started simultaneously (which the
   OS doesn't even offer IINM), the would soon run out of sync.

 How about you tell us what you *want*, and we tell you if and how it's
 possible to do that.

 Diez

Hello,

and thanks for all previous help.I want to measure memory usage of
executed python script.I'am working on windows XP.

Regards,
John
--
http://mail.python.org/mailman/listinfo/python-list


Re: Python and threads

2009-01-18 Thread Stefan Behnel
vedrandeko...@yahoo.com wrote:
 and thanks for all previous help.I want to measure memory usage of
 executed python script.I'am working on windows XP.

Could you qualify measure? Do you mean:

a) debug (permanently high accuracy, potentially high runtime overhead)
b) monitor (high accuracy, low/medium-resolution surveillance, no runtime
  overhead)
c) find out (low accuracy or just max usage, no permanent observation)

?

Stefan
--
http://mail.python.org/mailman/listinfo/python-list


Re: Problems with python and threads under Freebsd

2005-02-08 Thread Andrew MacIntyre
snacktime wrote:
After debugging this some more I narrowed it down to an encryption
function in pycrypto that is triggering the segfault.  I posted a bug
report.  Don't really know enough about threading to know whether it's
a python bug or a pycrypto bug, but I'll let someone else sort that
out now..
If you get bus errors, there's a possibility that you are running out of 
stack.

AFAIR, the default thread stack size for Posix builds is dependant on 
the threading implementation.  This can be overridden when building Python.

With each gcc version since 2.9, the size of stack frames for generated 
calls has increased.  If lowering the optimisation to -O or -Os when 
building Python improves the situation, I'd suggest pursuing this 
possibility further.

-
Andrew I MacIntyre These thoughts are mine alone...
E-mail: [EMAIL PROTECTED]  (pref) | Snail: PO Box 370
[EMAIL PROTECTED] (alt) |Belconnen ACT 2616
Web:http://www.andymac.org/   |Australia
--
http://mail.python.org/mailman/listinfo/python-list


Problems with python and threads under Freebsd

2005-02-07 Thread snacktime
I posted this to freebsd-questions, but though I would put it here
also in case anyone has any ideas.

I am consistantly getting seg faults and bus errors when running a
multi threaded python application under 5.3-release-p2.  Python was
built from the port(python 2.4) with threading enabled.  Rebuilding
with the huge stack size option enabled didn't make a difference.  The
application uses twisted (www.twistedmatrix.com) and it runs fine
until I put it under a bit of a load and have 20-30 simultaneous
threads running.  Then it core dumps.  Following is the backtrace from
the core file.  The backtrace is always the same.  

#0  0x2823cdbb in pthread_testcancel () from /usr/lib/libpthread.so.1
#1  0x28234b06 in pthread_mutexattr_init () from /usr/lib/libpthread.so.1
#2  0x in ?? ()
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Problems with python and threads under Freebsd

2005-02-07 Thread Stefan Schwarzer
snacktime wrote:
 I am consistantly getting seg faults and bus errors when running a
 multi threaded python application under 5.3-release-p2.  Python was
 built from the port(python 2.4) with threading enabled.

I had similar problems some time ago. The solution/workaround was to remove
the threading library-related mappings from /etc/libmap.conf . Perhaps you
need to do that or the opposite, i. e. add a mapping.

What do you get if you run the threading tests
in /usr/local/lib/python2.4/test/test_thread*.py ? In my case,
test_threaded_import.py failed before the libmap.conf change.

If the libmap.conf change doesn't help, you could try to rebuild the base
system and kernel and after that the Python port. Also, reading the
UPDATING files for the base system and the ports tree may give you a hint.

Stefan

-- 
http://mail.python.org/mailman/listinfo/python-list