Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > multiprocessing on freebsd

Reply
Thread Tools

multiprocessing on freebsd

 
 
Tim Arnold
Guest
Posts: n/a
 
      03-17-2010
Hi,
I'm checking to see if multiprocessing works on freebsd for any
version of python. My server is about to get upgraded from 6.3 to 8.0
and I'd sure like to be able to use multiprocessing.

I think the minimal test would be:
---------------------
import multiprocessing
q = multiprocessing.Queue()
---------------------

with 6.3, I get

File "/usr/local/lib/python2.6/multiprocessing/__init__.py", line
212, in Queue
from multiprocessing.queues import Queue
File "/usr/local/lib/python2.6/multiprocessing/queues.py", line 22,
in <module>
from multiprocessing.synchronize import Lock, BoundedSemaphore,
Semaphore, Condition
File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line
33, in <module>
" function, see issue 3770.")
ImportError: This platform lacks a functioning sem_open
implementation, therefore, the required synchronization primitives
needed will not function, see issue 3770.


thanks for any info,
--Tim Arnold
 
Reply With Quote
 
 
 
 
Philip Semanchuk
Guest
Posts: n/a
 
      03-17-2010

On Mar 17, 2010, at 9:30 AM, Tim Arnold wrote:

> Hi,
> I'm checking to see if multiprocessing works on freebsd for any
> version of python. My server is about to get upgraded from 6.3 to 8.0
> and I'd sure like to be able to use multiprocessing.
>
> I think the minimal test would be:
> ---------------------
> import multiprocessing
> q = multiprocessing.Queue()
> ---------------------
>
> with 6.3, I get
>
> File "/usr/local/lib/python2.6/multiprocessing/__init__.py", line
> 212, in Queue
> from multiprocessing.queues import Queue
> File "/usr/local/lib/python2.6/multiprocessing/queues.py", line 22,
> in <module>
> from multiprocessing.synchronize import Lock, BoundedSemaphore,
> Semaphore, Condition
> File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line
> 33, in <module>
> " function, see issue 3770.")
> ImportError: This platform lacks a functioning sem_open
> implementation, therefore, the required synchronization primitives
> needed will not function, see issue 3770.


Hi Tim,
Under FreeBSD 8/Python 2.6.2 I get the same result, unfortunately.
That's a pity because sem_open works under FreeBSD >= 7.2 as we
discussed before.


Issue 3770 is closed with the note, "we've removed hard-coded platform
variables for a better autoconf approach." I'm using the Python built
from FreeBSD's ports, and the note makes me think that it's possible
that if I built my own Python from the Python.org tarball rather than
ports the problem would go away due to autoconf magic. I don't have
the time to offer to do this for you, unfortunately. But why not
install FreeBSD 8 under VirtualBox or somesuch and give it a go
yourself?

A couple of quirks I noted related to FreeBSD & POSIX IPC that you
might find useful --
- The sem and mqueuefs kernel modules must be loaded, otherwise you'll
get a message like this when you try to create a semaphore or message
queue:
Bad system call: 12 (core dumped)

Under 8.0 they're loaded by default, I think.

- C apps that want to use message queues must link to the realtime
libs (pass -lrt to the linker). This tripped me up for a while.
Linking to the realtime libs is required for all POSIX IPC calls under
Linux; FreeBSD does not require it for semaphores or shared mem, only
message queues.


Hope this helps
Philip


 
Reply With Quote
 
 
 
 
Tim Arnold
Guest
Posts: n/a
 
      03-17-2010
On Mar 17, 11:26*am, Philip Semanchuk <(E-Mail Removed)> wrote:
> On Mar 17, 2010, at 9:30 AM, Tim Arnold wrote:
>
>
>
>
>
> > Hi,
> > I'm checking to see if multiprocessing works on freebsd for any
> > version of python. My server is about to get upgraded from 6.3 to 8.0
> > and I'd sure like to be able to use multiprocessing.

>
> > I think the minimal test would be:
> > ---------------------
> > import multiprocessing
> > q = multiprocessing.Queue()
> > ---------------------

>
> > with 6.3, I get

>
> > File "/usr/local/lib/python2.6/multiprocessing/__init__.py", line
> > 212, in Queue
> > * *from multiprocessing.queues import Queue
> > *File "/usr/local/lib/python2.6/multiprocessing/queues.py", line 22,
> > in <module>
> > * *from multiprocessing.synchronize import Lock, BoundedSemaphore,
> > Semaphore, Condition
> > *File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line
> > 33, in <module>
> > * *" function, see issue 3770.")
> > ImportError: This platform lacks a functioning sem_open
> > implementation, therefore, the required synchronization primitives
> > needed will not function, see issue 3770.

>
> Hi Tim,
> Under FreeBSD 8/Python 2.6.2 I get the same result, unfortunately. *
> That's a pity because sem_open works under FreeBSD >= 7.2 as we *
> discussed before.
>
> Issue 3770 is closed with the note, "we've removed hard-coded platform *
> variables for a better autoconf approach." I'm using the Python built *
> from FreeBSD's ports, and the note makes me think that it's possible *
> that if I built my own Python from the Python.org tarball rather than *
> ports the problem would go away due to autoconf magic. I don't have *
> the time to offer to do this for you, unfortunately. But why not *
> install FreeBSD 8 under VirtualBox or somesuch and give it a go *
> yourself?
>
> A couple of quirks I noted related to FreeBSD & POSIX IPC that you *
> might find useful --
> - The sem and mqueuefs kernel modules must be loaded, otherwise you'll *
> get a message like this when you try to create a semaphore or message *
> queue:
> Bad system call: 12 (core dumped)
>
> Under 8.0 they're loaded by default, I think.
>
> - C apps that want to use message queues must link to the realtime *
> libs (pass -lrt to the linker). This tripped me up for a while. *
> Linking to the realtime libs is required for all POSIX IPC calls under *
> Linux; FreeBSD does not require it for semaphores or shared mem, only *
> message queues.
>
> Hope this helps
> Philip


Hi Philip,
Thanks for that information (esp the linker info). Once the machine is
upgraded, I'll try building python from the tarball. I'll post back
here with the results.

here's hoping!
thanks,
--Tim
 
Reply With Quote
 
Martin P. Hellwig
Guest
Posts: n/a
 
      03-17-2010
On 03/17/10 13:30, Tim Arnold wrote:
> Hi,
> I'm checking to see if multiprocessing works on freebsd for any
> version of python. My server is about to get upgraded from 6.3 to 8.0
> and I'd sure like to be able to use multiprocessing.
>
> I think the minimal test would be:
> ---------------------
> import multiprocessing
> q = multiprocessing.Queue()
> ---------------------
>
> with 6.3, I get
>
> File "/usr/local/lib/python2.6/multiprocessing/__init__.py", line
> 212, in Queue
> from multiprocessing.queues import Queue
> File "/usr/local/lib/python2.6/multiprocessing/queues.py", line 22,
> in<module>
> from multiprocessing.synchronize import Lock, BoundedSemaphore,
> Semaphore, Condition
> File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line
> 33, in<module>
> " function, see issue 3770.")
> ImportError: This platform lacks a functioning sem_open
> implementation, therefore, the required synchronization primitives
> needed will not function, see issue 3770.
>


Build mine from ports, with the following options (notice SEM & PTH):
[martin@aspire8930 /usr/home/martin]$ cat /var/db/ports/python26/options
# This file is auto-generated by 'make config'.
# No user-servicable parts inside!
# Options for python26-2.6.4
_OPTIONS_READ=python26-2.6.4
WITH_THREADS=true
WITHOUT_HUGE_STACK_SIZE=true
WITH_SEM=true
WITH_PTH=true
WITH_UCS4=true
WITH_PYMALLOC=true
WITH_IPV6=true
WITHOUT_FPECTL=true

[martin@aspire8930 /usr/home/martin]$ uname -a
FreeBSD aspire8930 8.0-STABLE FreeBSD 8.0-STABLE #3: Wed Feb 3 17:01:18
GMT 2010 martin@aspire8930:/usr/obj/usr/src/sys/ASPIRE8930 amd64
[martin@aspire8930 /usr/home/martin]$ python
Python 2.6.4 (r264:75706, Mar 17 2010, 18:44:24)
[GCC 4.2.1 20070719 [FreeBSD]] on freebsd8
Type "help", "copyright", "credits" or "license" for more information.
>>> import multiprocessing as mp
>>> queue = mp.Queue()
>>>


hth
--
mph
 
Reply With Quote
 
Tim Arnold
Guest
Posts: n/a
 
      03-18-2010
"Martin P. Hellwig" <(E-Mail Removed)> wrote in message
news:hnrabj$c4v$(E-Mail Removed)-september.org...
> On 03/17/10 13:30, Tim Arnold wrote:
>> Hi,
>> I'm checking to see if multiprocessing works on freebsd for any
>> version of python. My server is about to get upgraded from 6.3 to 8.0
>> and I'd sure like to be able to use multiprocessing.
>>
>> I think the minimal test would be:
>> ---------------------
>> import multiprocessing
>> q = multiprocessing.Queue()
>> ---------------------
>>
>> with 6.3, I get
>>
>> File "/usr/local/lib/python2.6/multiprocessing/__init__.py", line
>> 212, in Queue
>> from multiprocessing.queues import Queue
>> File "/usr/local/lib/python2.6/multiprocessing/queues.py", line 22,
>> in<module>
>> from multiprocessing.synchronize import Lock, BoundedSemaphore,
>> Semaphore, Condition
>> File "/usr/local/lib/python2.6/multiprocessing/synchronize.py", line
>> 33, in<module>
>> " function, see issue 3770.")
>> ImportError: This platform lacks a functioning sem_open
>> implementation, therefore, the required synchronization primitives
>> needed will not function, see issue 3770.
>>

>
> Build mine from ports, with the following options (notice SEM & PTH):
> [martin@aspire8930 /usr/home/martin]$ cat /var/db/ports/python26/options
> # This file is auto-generated by 'make config'.
> # No user-servicable parts inside!
> # Options for python26-2.6.4
> _OPTIONS_READ=python26-2.6.4
> WITH_THREADS=true
> WITHOUT_HUGE_STACK_SIZE=true
> WITH_SEM=true
> WITH_PTH=true
> WITH_UCS4=true
> WITH_PYMALLOC=true
> WITH_IPV6=true
> WITHOUT_FPECTL=true
>
> [martin@aspire8930 /usr/home/martin]$ uname -a
> FreeBSD aspire8930 8.0-STABLE FreeBSD 8.0-STABLE #3: Wed Feb 3 17:01:18
> GMT 2010 martin@aspire8930:/usr/obj/usr/src/sys/ASPIRE8930 amd64
> [martin@aspire8930 /usr/home/martin]$ python
> Python 2.6.4 (r264:75706, Mar 17 2010, 18:44:24)
> [GCC 4.2.1 20070719 [FreeBSD]] on freebsd8
> Type "help", "copyright", "credits" or "license" for more information.
> >>> import multiprocessing as mp
> >>> queue = mp.Queue()
> >>>

>
> hth
> --
> mph


Hi Martin, thanks very much for posting that. All I can say is YAY! I'm
really looking forward to my machine's upgrade now!

thanks,
--Tim


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
freebsd and multiprocessing Tim Arnold Python 5 03-02-2010 08:57 PM
New FreeBSD Logo Aquila Deus Computer Support 2 02-10-2005 02:15 PM
FreeBSD 4.5 + ISL =) . Mft . Cisco 2 08-23-2004 11:17 PM
FreeBSD Application/Network Problem Llewellyn Angus Computer Support 3 07-21-2004 03:47 AM
Cisco WS-C1924-EN vlan trunk to FreeBSD or Linux Robert Bala Cisco 1 04-13-2004 04:29 AM



Advertisments